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..03ab37453 --- /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_mesh_manifold",zt="MERGE";class bt extends Ce{static EXTENSION_NAME=Y;init(){bt.EXTENSION_NAME=Y,this.propertyType="ManifoldPrimitive",this.parentTypes=[M.MESH]}getDefaults(){return Object.assign(super.getDefaults(),{manifoldPrimitive:null,mergeIndices:null,mergeValues:null})}getMergeIndices(){return this.getRef("mergeIndices")}getMergeValues(){return this.getRef("mergeValues")}setMerge(e,t){if(e.getCount()!==t.getCount())throw new Error("merge vectors must be the same length.");return this.setRef("mergeIndices",e),this.setRef("mergeValues",t)}getRunIndex(){return this.get("runIndex")}setRunIndex(e){return this.set("runIndex",e)}setIndices(e){return this.setRef("indices",e)}getIndices(){return this.getRef("indices")}}class 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_mesh_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_mesh_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_mesh_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=ta(N),N in At)return;At[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":ra,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 oa=(()=>{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 Dt(e){return f.locateFile?f.locateFile(e,I):I+e}var Te,Fe,Ve;if(Q){const{createRequire:e}=await na(()=>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 Mt(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 Rt(){if(f.preRun)for(typeof f.preRun=="function"&&(f.preRun=[f.preRun]);f.preRun.length;)Ot(f.preRun.shift());yr(Ir)}function jt(){!f.noFSInit&&!a.init.initialized&&a.init(),a.ignorePermissions=!1,yr(Ur)}function xt(){if(f.postRun)for(typeof f.postRun=="function"&&(f.postRun=[f.postRun]);f.postRun.length;)zt(f.postRun.shift());yr(Vr)}function Ot(e){Ir.unshift(e)}function Wt(e){Ur.unshift(e)}function zt(e){Vr.unshift(e)}var de=0,De=null;function ia(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 Lt="data:application/octet-stream;base64,";function Hr(e){return e.startsWith(Lt)}function Ge(e){return e.startsWith("file://")}var ve;f.locateFile?(ve="manifold.wasm",Hr(ve)||(ve=Dt(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 It(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 It(e).then(n=>WebAssembly.instantiate(n,r)).then(n=>n).then(t,n=>{ae(`failed to asynchronously prepare wasm: ${n}`),K(n)})}function Ut(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 Vt(){var e={a:no};function r(n,i){var o=n.exports;return O=o,Be=O.Ua,Lr(),ce=O.Wa,Wt(O.Va),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 Ut($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,Ht=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,Bt=()=>{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 Nt=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},Yt=()=>Yr([]),qt=e=>Yr([e]),Gt=()=>{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},Xt=(e,r,t)=>{var n=new _r(e);throw n.init(r,t),te=e,Ke++,te},Kt=()=>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)},Jt=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}]})},Zt=(e,r,t,n,i)=>{},Qt=()=>{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,j=e=>{throw new we(e)};function en(e,r,t={}){var n=r.name;if(e||j(`type "${n}" must have a positive integer typeid pointer`),he.hasOwnProperty(e)){if(t.ignoreDuplicateRegistrations)return;j(`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 en(e,r,t)}var re=8,rn=(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 tn(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 nn=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}j(r(e)+" instance already deleted")},br=!1,Xr=e=>{},on=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&&on(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={},an=()=>Object.keys(je).length,sn=()=>{var e=[];for(var r in je)je.hasOwnProperty(r)&&e.push(je[r]);return e},Me=[],kr=()=>{for(;Me.length;){var e=Me.pop();e.$$.deleteScheduled=!1,e.delete()}},Re=void 0,un=e=>{Re=e,Me.length&&Re&&Re(kr)},ln=()=>{f.getInheritedInstanceCount=an,f.getLiveInheritedInstances=sn,f.flushPendingDeletes=kr,f.setDelayFunction=un},je={},fn=(e,r)=>{for(r===void 0&&j("ptr should not be undefined");e.baseClass;)r=e.upcast(r),e=e.baseClass;return r},cn=(e,r)=>(r=fn(e,r),je[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},xe(Object.create(e,{$$:{value:r}}))};function dn(e){var r=this.getPointee(e);if(!r)return this.destructor(e),null;var t=cn(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 xe=e=>typeof FinalizationRegistry>"u"?(xe=r=>r,e):(br=new FinalizationRegistry(r=>{Kr(r.$$)}),xe=r=>{var t=r.$$,n=!!t.smartPtr;if(n){var i={$$:t};br.register(r,i,r)}return r},Xr=r=>br.unregister(r),xe(e));function vn(){if(this.$$.ptr||Er(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e=xe(Object.create(Object.getPrototypeOf(this),{$$:{value:nn(this.$$)}}));return e.$$.count.value+=1,e.$$.deleteScheduled=!1,e}function hn(){this.$$.ptr||Er(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&j("Object already scheduled for deletion"),Xr(this),Kr(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)}function pn(){return!this.$$.ptr}function mn(){return this.$$.ptr||Er(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&j("Object already scheduled for deletion"),Me.push(this),Me.length===1&&Re&&Re(kr),this.$$.deleteScheduled=!0,this}var yn=()=>{ue.prototype.isAliasOf=tn,ue.prototype.clone=vn,ue.prototype.delete=hn,ue.prototype.isDeleted=pn,ue.prototype.deleteLater=mn};function ue(){}var _n=48,gn=57,rr=e=>{if(e===void 0)return"_unknown";e=e.replace(/[^a-zA-Z0-9_]/g,"$");var r=e.charCodeAt(0);return r>=_n&&r<=gn?`_${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)||j(`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)&&j(`Cannot register public name '${e}' twice`),Qr(f,e,e),f.hasOwnProperty(t)&&j(`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 wn(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||j(`Expected null or instance of ${t.name}, got an instance of ${r.name}`),e=r.upcast(e),r=r.baseClass;return e};function En(e,r){if(r===null)return this.isReference&&j(`null is not a valid ${this.name}`),0;r.$$||j(`Cannot pass "${$r(r)}" as a ${this.name}`),r.$$.ptr||j(`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 bn(e,r){var t;if(r===null)return this.isReference&&j(`null is not a valid ${this.name}`),this.isSmartPointer?(t=this.rawConstructor(),e!==null&&e.push(this.rawDestructor,t),t):0;r.$$||j(`Cannot pass "${$r(r)}" as a ${this.name}`),r.$$.ptr||j(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&r.$$.ptrType.isConst&&j(`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&&j("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:r.$$.smartPtrType===this?t=r.$$.smartPtr:j(`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:j("Unsupporting sharing policy")}return t}function kn(e,r){if(r===null)return this.isReference&&j(`null is not a valid ${this.name}`),0;r.$$||j(`Cannot pass "${$r(r)}" as a ${this.name}`),r.$$.ptr||j(`Cannot pass deleted object as a pointer of type ${this.name}`),r.$$.ptrType.isConst&&j(`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 Pn(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e}function Cn(e){this.rawDestructor&&this.rawDestructor(e)}var Sn=e=>{e!==null&&e.delete()},Tn=()=>{ne.prototype.getPointee=Pn,ne.prototype.destructor=Cn,ne.prototype.argPackAdvance=re,ne.prototype.readValueFromPointer=et,ne.prototype.deleteObject=Sn,ne.prototype.fromWireType=dn};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=En,this.destructorFunction=null):(this.toWireType=kn,this.destructorFunction=null):this.toWireType=bn}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)},Fn=(e,r,t)=>{var n=f["dynCall_"+e];return t&&t.length?n.apply(null,[r].concat(t)):n.call(null,r)},Oe=[],C=e=>{var r=Oe[e];return r||(e>=Oe.length&&(Oe.length=e+1),Oe[e]=r=ce.get(e)),r},$n=(e,r,t)=>{if(e.includes("j"))return Fn(e,r,t);var n=C(r).apply(null,t);return n},An=(e,r)=>{var t=[];return function(){return t.length=0,Object.assign(t,arguments),$n(e,r,t)}},Z=(e,r)=>{e=V(e);function t(){return e.includes("j")?An(e,r):C(r)}var n=t();return typeof n!="function"&&j(`unknown function pointer with signature ${e}: ${r}`),n},Dn=(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([", "]))},Mn=(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 wn(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&&j("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),[])),[]})},jn=(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 xn(){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)},On=()=>{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=On},z={toValue:e=>(e||j("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})}}},zn=(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})},Ln=(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}`)}},In=(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:Ln(r,t,n),destructorFunction:null}),Pr(r,i)},ir=(e,r)=>{var t=he[e];return t===void 0&&j(r+" has unknown type "+nt(e)),t},Un=(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},Vn=(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}`)}},Hn=(e,r,t)=>{r=V(r),ee(e,{name:r,fromWireType:n=>n,toWireType:(n,i)=>i,argPackAdvance:re,readValueFromPointer:Vn(r,t),destructorFunction:null})},Bn=(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),[]})},Nn=(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}`)}},Yn=(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:Nn(r,t,n!==0),destructorFunction:null})},qn=(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},Gn=(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):"",Xn=(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||j("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)Gn(i,d,o+1);else if(s)for(var v=0;v255&&(oe(d),j("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,Kn=(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},Jn=(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},Zn=e=>e.length*2,Qn=(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},ei=(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},ri=e=>{for(var r=0,t=0;t=55296&&n<=57343&&++t,r+=4}return r},ti=(e,r,t)=>{t=V(t);var n,i,o,s,u;r===2?(n=Kn,i=Jn,s=Zn,o=()=>Ae,u=1):r===4&&(n=Qn,i=ei,s=ri,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"&&j(`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)})},ni=(e,r,t,n,i,o)=>{Je[e]={name:V(r),rawConstructor:Z(t,n),rawDestructor:Z(i,o),fields:[]}},ii=(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})},oi=(e,r)=>{r=V(r),ee(e,{isVoid:!0,name:r,argPackAdvance:0,fromWireType:()=>{},toWireType:(t,n)=>{}})},ai=(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)},si=e=>{var r=[];return $[e>>2]=z.toHandle(r),r},ui={},Mr=e=>{var r=ui[e];return r===void 0?V(e):r},ar=[],li=(e,r,t,n,i)=>(e=ar[e],r=z.toValue(r),t=Mr(t),e(r,t,si(n),i)),fi=(e,r,t,n)=>{e=ar[e],r=z.toValue(r),t=Mr(t),e(r,t,null,n)},ci=(e,r)=>(e=z.toValue(e),r=z.toValue(r),e==r),di=e=>{var r=ar.length;return ar.push(e),r},vi=(e,r)=>{for(var t=new Array(e),n=0;n>2],"parameter "+n);return t},ut=[],hi=(e,r)=>{var t=vi(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])),mi=e=>{e>4&&(G.get(e).refcount+=1)},yi=e=>z.toHandle(Mr(e)),_i=()=>z.toHandle({}),gi=e=>{var r=z.toValue(e);gr(r),Fr(e)},wi=(e,r,t)=>{e=z.toValue(e),r=z.toValue(r),t=z.toValue(t),e[r]=t},Ei=(e,r)=>{e=ir(e,"_emval_take_value");var t=e.readValueFromPointer(r);return z.toHandle(t)},bi=()=>{K("")},ki=(e,r,t)=>H.copyWithin(e,r,r+t),Pi=()=>2147483648,Ci=e=>{var r=Be.buffer,t=(e-r.byteLength+65535)/65536;try{return Be.grow(t),Lr(),1}catch{}},Si=e=>{var r=H.length;e>>>=0;var t=Pi();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=Ci(s);if(u)return!0}return!1},Rr={},Ti=()=>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,_:Ti()};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},Fi=(e,r)=>{for(var t=0;t>0]=e.charCodeAt(t);W[r>>0]=0},x={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=x.isAbs(e),t=e.substr(-1)==="/";return e=x.normalizeArray(e.split("/").filter(n=>!!n),!r).join("/"),!e&&!r&&(e="."),e&&t&&(e+="/"),(r?"/":"")+e},dirname:e=>{var r=x.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=x.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 x.normalize(e.join("/"))},join2:(e,r)=>x.normalize(e+"/"+r)},$i=()=>{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=$i())(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=x.isAbs(n)}return e=x.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 Ai=()=>{if(!jr.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;jr=sr(e,!0)}return jr.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()},S={ops_table:null,mount(e){return S.createNode(null,"/",16895,0)},createNode(e,r,t,n){if(a.isBlkdev(t)||a.isFIFO(t))throw new a.ErrnoError(63);S.ops_table||(S.ops_table={dir:{node:{getattr:S.node_ops.getattr,setattr:S.node_ops.setattr,lookup:S.node_ops.lookup,mknod:S.node_ops.mknod,rename:S.node_ops.rename,unlink:S.node_ops.unlink,rmdir:S.node_ops.rmdir,readdir:S.node_ops.readdir,symlink:S.node_ops.symlink},stream:{llseek:S.stream_ops.llseek}},file:{node:{getattr:S.node_ops.getattr,setattr:S.node_ops.setattr},stream:{llseek:S.stream_ops.llseek,read:S.stream_ops.read,write:S.stream_ops.write,allocate:S.stream_ops.allocate,mmap:S.stream_ops.mmap,msync:S.stream_ops.msync}},link:{node:{getattr:S.node_ops.getattr,setattr:S.node_ops.setattr,readlink:S.node_ops.readlink},stream:{}},chrdev:{node:{getattr:S.node_ops.getattr,setattr:S.node_ops.setattr},stream:a.chrdev_stream_ops}});var i=a.createNode(e,r,t,n);return a.isDir(i.mode)?(i.node_ops=S.ops_table.dir.node,i.stream_ops=S.ops_table.dir.stream,i.contents={}):a.isFile(i.mode)?(i.node_ops=S.ops_table.file.node,i.stream_ops=S.ops_table.file.stream,i.usedBytes=0,i.contents=null):a.isLink(i.mode)?(i.node_ops=S.ops_table.link.node,i.stream_ops=S.ops_table.link.stream):a.isChrdev(i.mode)&&(i.node_ops=S.ops_table.chrdev.node,i.stream_ops=S.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&&S.resizeFileStorage(e,r.size)},lookup(e,r){throw a.genericErrors[44]},mknod(e,r,t,n){return S.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=S.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=>{Mt(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()},Mi=f.preloadPlugins||[],Ri=(e,r,t,n)=>{typeof Browser<"u"&&Browser.init();var i=!1;return Mi.forEach(o=>{i||o.canHandle(r)&&(o.handle(e,r,t,n),i=!0)}),i},ji=(e,r,t,n,i,o,s,u,d,v)=>{var m=r?ie.resolve(x.join2(e,r)):e;function g(y){function _(E){v&&v(),u||a.createDataFile(e,r,E,n,i,d),o&&o(),qe()}Ri(y,m,_,()=>{s&&s(),qe()})||_(y)}mr(),typeof t=="string"?Di(t,y=>g(y),s):g(t)},xi=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},xr=(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=x.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=x.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=x.dirname(e),n=x.dirname(r),i=x.basename(e),o=x.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=x.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=x.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"?xi(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=x.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(S,{},"/"),a.createDefaultDirectories(),a.createDefaultDevices(),a.createSpecialDirectories(),a.filesystems={MEMFS:S}},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(x.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 x.join2(n,r)},doStat(e,r,t){try{var n=e(r)}catch(u){if(u&&u.node&&x.normalize(r)!==x.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}},Oi=(e,r)=>{var t=0;return We().forEach((n,i)=>{var o=r+t;$[e+i*4>>2]=o,Fi(n,o),t+=n.length+1}),0},Wi=(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 zi(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 Li=(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 Ui=(e,r)=>r+2097152>>>0<4194305-!!e?(e>>>0)+r*4294967296:NaN;function Vi(e,r,t,n,i){var o=Ui(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 Hi=(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 Bi(e,r,t,n){try{var i=le.getStreamFromFD(e),o=Hi(i,r,t);return $[n>>2]=o,0}catch(s){if(typeof a>"u"||s.name!=="ErrnoError")throw s;return s.errno}}var Ni=e=>e,ur=e=>e%4===0&&(e%100!==0||e%400===0),Yi=(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],qi=(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},Gi=(e,r)=>{W.set(e,r)},Xi=(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=qi(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+Yi(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:(Gi(c,e),c.length-1)},Ki=(e,r,t,n,i)=>Xi(e,r,t,n),vt=(e,r)=>{e<128?r.push(e):r.push(e%128|128,e>>7)},Ji=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(Ji(r),e);var t=[1];Zi(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},eo=(e,r)=>{if(ye)for(var t=e;t(ye||(ye=new WeakMap,eo(0,ce.length)),ye.get(e)||0),Or=[],to=()=>{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=ro(e);if(t)return t;var n=to();try{ht(n,e)}catch(o){if(!(o instanceof TypeError))throw o;var i=Qi(e,r);ht(n,i)}return ye.set(e,n),n},Le=e=>{ye.delete(C(e)),Or.push(e)};qr=f.InternalError=class extends Error{constructor(r){super(r),this.name="InternalError"}},Qt(),we=f.BindingError=class extends Error{constructor(r){super(r),this.name="BindingError"}},yn(),ln(),Tn(),tt=f.UnboundTypeError=Dn(Error,"UnboundTypeError"),xn(),Wn();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=ji,a.staticInit();var no={C:Ht,M:Bt,a:Yt,k:qt,U:Gt,h:Xt,qa:Kt,d:Nt,Ka:Jt,da:Zt,va:rn,y:Mn,x:Rn,j:jn,ta:zn,Q:In,t:Un,W:Hn,o:Bn,A:Yn,s:qn,V:Xn,O:ti,F:ni,La:ii,wa:oi,Qa:ai,Fa:li,Na:fi,Sa:Fr,Pa:ci,Ja:hi,Ra:pi,Oa:mi,H:yi,aa:_i,ua:gi,Ta:wi,z:Ei,N:bi,sa:ki,ra:Si,ma:Oi,na:Wi,oa:zi,pa:Ii,ca:Vi,T:Bi,za:Lo,G:go,J:lo,B:ao,E:wo,$:yo,xa:Uo,R:Bo,Ca:Oo,r:jo,c:uo,b:oo,n:ho,l:vo,P:Fo,D:Vo,S:Ho,L:No,ba:ea,i:_o,f:so,Ha:Co,g:fo,Da:xo,I:Po,_:bo,Ia:ko,u:So,Ba:Wo,Aa:zo,Ea:To,e:io,Ma:po,m:co,q:Eo,ya:Io,Z:Ao,v:$o,w:Mo,X:Ro,p:mo,K:Yo,Y:Do,fa:Zo,ia:Xo,ka:qo,ja:Go,ga:Jo,ha:Ko,ea:Qo,Ga:Ni,la:Ki},O=Vt(),Wr=e=>(Wr=O.Xa)(e),oe=e=>(oe=O.Ya)(e),mt=e=>(mt=O.Za)(e);f.__embind_initialize_bindings=()=>(f.__embind_initialize_bindings=O._a)();var b=(e,r)=>(b=O.$a)(e,r),Ie=e=>(Ie=O.ab)(e),k=()=>(k=O.bb)(),P=e=>(P=O.cb)(e),yt=e=>(yt=O.db)(e),_t=e=>(_t=O.eb)(e),gt=(e,r,t)=>(gt=O.fb)(e,r,t),wt=e=>(wt=O.gb)(e),Et=f.dynCall_viiji=(e,r,t,n,i,o)=>(Et=f.dynCall_viiji=O.hb)(e,r,t,n,i,o),bt=f.dynCall_viijii=(e,r,t,n,i,o,s)=>(bt=f.dynCall_viijii=O.ib)(e,r,t,n,i,o,s),kt=f.dynCall_viiij=(e,r,t,n,i,o)=>(kt=f.dynCall_viiij=O.jb)(e,r,t,n,i,o),Pt=f.dynCall_vijiii=(e,r,t,n,i,o,s)=>(Pt=f.dynCall_vijiii=O.kb)(e,r,t,n,i,o,s),Ct=f.dynCall_vijii=(e,r,t,n,i,o)=>(Ct=f.dynCall_vijii=O.lb)(e,r,t,n,i,o),St=f.dynCall_viiiij=(e,r,t,n,i,o,s)=>(St=f.dynCall_viiiij=O.mb)(e,r,t,n,i,o,s),Tt=f.dynCall_vijij=(e,r,t,n,i,o,s)=>(Tt=f.dynCall_vijij=O.nb)(e,r,t,n,i,o,s);f.dynCall_jiji=(e,r,t,n,i)=>(f.dynCall_jiji=O.ob)(e,r,t,n,i);var Ft=f.dynCall_jiiii=(e,r,t,n,i)=>(Ft=f.dynCall_jiiii=O.pb)(e,r,t,n,i);f.dynCall_iiiiij=(e,r,t,n,i,o,s)=>(f.dynCall_iiiiij=O.qb)(e,r,t,n,i,o,s),f.dynCall_iiiiijj=(e,r,t,n,i,o,s,u,d)=>(f.dynCall_iiiiijj=O.rb)(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.sb)(e,r,t,n,i,o,s,u,d,v);function io(e,r,t,n){var i=k();try{C(e)(r,t,n)}catch(o){if(P(i),o!==o+0)throw o;b(1,0)}}function oo(e,r,t){var n=k();try{return C(e)(r,t)}catch(i){if(P(n),i!==i+0)throw i;b(1,0)}}function ao(e,r,t,n,i,o){var s=k();try{return C(e)(r,t,n,i,o)}catch(u){if(P(s),u!==u+0)throw u;b(1,0)}}function so(e,r){var t=k();try{C(e)(r)}catch(n){if(P(t),n!==n+0)throw n;b(1,0)}}function uo(e,r){var t=k();try{return C(e)(r)}catch(n){if(P(t),n!==n+0)throw n;b(1,0)}}function lo(e,r,t,n){var i=k();try{return C(e)(r,t,n)}catch(o){if(P(i),o!==o+0)throw o;b(1,0)}}function fo(e,r,t){var n=k();try{C(e)(r,t)}catch(i){if(P(n),i!==i+0)throw i;b(1,0)}}function co(e,r,t,n,i){var o=k();try{C(e)(r,t,n,i)}catch(s){if(P(o),s!==s+0)throw s;b(1,0)}}function vo(e,r,t,n,i){var o=k();try{return C(e)(r,t,n,i)}catch(s){if(P(o),s!==s+0)throw s;b(1,0)}}function ho(e,r,t,n){var i=k();try{return C(e)(r,t,n)}catch(o){if(P(i),o!==o+0)throw o;b(1,0)}}function po(e,r,t,n,i,o,s){var u=k();try{C(e)(r,t,n,i,o,s)}catch(d){if(P(u),d!==d+0)throw d;b(1,0)}}function mo(e,r,t,n,i,o,s,u,d,v,m){var g=k();try{C(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 yo(e,r,t){var n=k();try{return C(e)(r,t)}catch(i){if(P(n),i!==i+0)throw i;b(1,0)}}function _o(e){var r=k();try{C(e)()}catch(t){if(P(r),t!==t+0)throw t;b(1,0)}}function go(e,r,t){var n=k();try{return C(e)(r,t)}catch(i){if(P(n),i!==i+0)throw i;b(1,0)}}function wo(e,r){var t=k();try{return C(e)(r)}catch(n){if(P(t),n!==n+0)throw n;b(1,0)}}function Eo(e,r,t,n,i,o){var s=k();try{C(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{C(e)(r,t,n,i)}catch(s){if(P(o),s!==s+0)throw s;b(1,0)}}function ko(e,r,t,n,i,o,s,u,d){var v=k();try{C(e)(r,t,n,i,o,s,u,d)}catch(m){if(P(v),m!==m+0)throw m;b(1,0)}}function Po(e,r,t,n,i,o){var s=k();try{C(e)(r,t,n,i,o)}catch(u){if(P(s),u!==u+0)throw u;b(1,0)}}function Co(e,r,t,n){var i=k();try{C(e)(r,t,n)}catch(o){if(P(i),o!==o+0)throw o;b(1,0)}}function So(e,r,t,n){var i=k();try{C(e)(r,t,n)}catch(o){if(P(i),o!==o+0)throw o;b(1,0)}}function To(e,r,t,n,i,o,s){var u=k();try{C(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,o){var s=k();try{return C(e)(r,t,n,i,o)}catch(u){if(P(s),u!==u+0)throw u;b(1,0)}}function $o(e,r,t,n,i,o,s){var u=k();try{C(e)(r,t,n,i,o,s)}catch(d){if(P(u),d!==d+0)throw d;b(1,0)}}function Ao(e,r,t,n,i,o,s){var u=k();try{C(e)(r,t,n,i,o,s)}catch(d){if(P(u),d!==d+0)throw d;b(1,0)}}function Do(e,r,t,n,i,o,s,u,d,v,m,g,y,_,E,A,R,c,l){var h=k();try{C(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 Mo(e,r,t,n,i,o,s,u){var d=k();try{C(e)(r,t,n,i,o,s,u)}catch(v){if(P(d),v!==v+0)throw v;b(1,0)}}function Ro(e,r,t,n,i,o,s,u,d,v){var m=k();try{C(e)(r,t,n,i,o,s,u,d,v)}catch(g){if(P(m),g!==g+0)throw g;b(1,0)}}function jo(e){var r=k();try{return C(e)()}catch(t){if(P(r),t!==t+0)throw t;b(1,0)}}function xo(e,r,t,n){var i=k();try{C(e)(r,t,n)}catch(o){if(P(i),o!==o+0)throw o;b(1,0)}}function Oo(e,r,t,n,i){var o=k();try{return C(e)(r,t,n,i)}catch(s){if(P(o),s!==s+0)throw s;b(1,0)}}function Wo(e,r,t,n,i){var o=k();try{C(e)(r,t,n,i)}catch(s){if(P(o),s!==s+0)throw s;b(1,0)}}function zo(e,r,t,n,i,o){var s=k();try{C(e)(r,t,n,i,o)}catch(u){if(P(s),u!==u+0)throw u;b(1,0)}}function Lo(e){var r=k();try{return C(e)()}catch(t){if(P(r),t!==t+0)throw t;b(1,0)}}function Io(e,r,t,n,i,o,s){var u=k();try{C(e)(r,t,n,i,o,s)}catch(d){if(P(u),d!==d+0)throw d;b(1,0)}}function Uo(e,r,t,n){var i=k();try{return C(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{return C(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){var d=k();try{return C(e)(r,t,n,i,o,s,u)}catch(v){if(P(d),v!==v+0)throw v;b(1,0)}}function Bo(e,r,t,n){var i=k();try{return C(e)(r,t,n)}catch(o){if(P(i),o!==o+0)throw o;b(1,0)}}function No(e,r,t,n,i,o,s,u,d,v,m,g){var y=k();try{return C(e)(r,t,n,i,o,s,u,d,v,m,g)}catch(_){if(P(y),_!==_+0)throw _;b(1,0)}}function Yo(e,r,t,n,i,o,s,u,d,v,m,g,y,_,E,A){var R=k();try{C(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 qo(e,r,t,n,i,o){var s=k();try{Et(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{bt(e,r,t,n,i,o,s)}catch(d){if(P(u),d!==d+0)throw d;b(1,0)}}function Xo(e,r,t,n,i,o){var s=k();try{kt(e,r,t,n,i,o)}catch(u){if(P(s),u!==u+0)throw u;b(1,0)}}function Ko(e,r,t,n,i,o,s){var u=k();try{Pt(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){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 Zo(e,r,t,n,i,o,s){var u=k();try{St(e,r,t,n,i,o,s)}catch(d){if(P(u),d!==d+0)throw d;b(1,0)}}function Qo(e,r,t,n,i,o,s){var u=k();try{Tt(e,r,t,n,i,o,s)}catch(d){if(P(u),d!==d+0)throw d;b(1,0)}}function ea(e,r,t,n,i){var o=k();try{return Ft(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||$t(),cr||(De=e)};function $t(){if(de>0||(Rt(),de>0))return;function e(){cr||(cr=!0,f.calledRun=!0,!zr&&(jt(),Ue(f),f.onRuntimeInitialized&&f.onRuntimeInitialized(),xt()))}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 $t(),Ce.ready}})();export{oa as M}; diff --git a/assets/manifold.wasm b/assets/manifold.wasm new file mode 100644 index 000000000..caeaf5993 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..560054ffd --- /dev/null +++ b/assets/manifoldCAD.js @@ -0,0 +1,19 @@ +import"./modulepreload-polyfill.js";function ne(){return new Worker("/assets/worker-816261e9.js",{type:"module"})}const q="",y=self.examples.functionBodies;navigator.serviceWorker&&navigator.serviceWorker.register("/service-worker.js",{scope:"./index.html"});let l;const oe=document.querySelector("#undo"),le=document.querySelector("#redo"),ce=document.querySelector("#format"),ie=document.querySelector("#share");oe.onclick=()=>l.trigger("ignored","undo");le.onclick=()=>l.trigger("ignored","redo");ce.onclick=()=>l.trigger("ignored","editor.action.formatDocument");ie.onclick=()=>{const e=new URL(window.location.toString());e.hash="#"+encodeURIComponent(m.textContent+q+l.getValue()),navigator.clipboard.writeText(e.toString()),console.log("Shareable link copied to clipboard!"),console.log("Consider shortening this URL using tinyURL.com")};const re=document.querySelector("#file"),m=document.querySelector("#current"),H=document.querySelector("#file .uparrow"),I=document.querySelector("#fileDropdown"),$=document.querySelector("#save"),h=document.querySelector("#saveDropdown"),E=document.querySelector("#save .uparrow"),se=function(){I.classList.remove("show"),h.classList.remove("show"),H.classList.remove("down"),E.classList.remove("down")},ae=function(e){e.stopPropagation(),I.classList.toggle("show"),H.classList.toggle("down")},ue=function(e){e.stopPropagation(),h.classList.toggle("show"),E.classList.toggle("down")};re.onclick=ae;E.parentElement.onclick=ue;document.body.onclick=se;const C="ManifoldCAD";function L(e){return window.localStorage.getItem(C+e)}function g(e,n){window.localStorage.setItem(C+e,n)}function z(e){window.localStorage.removeItem(C+e)}function de(e){if(e>=window.localStorage.length)return;const n=window.localStorage.key(e);if(n.startsWith(C))return n.slice(C.length)}function R(){if(l){const e=m.textContent;y.get(e)||g(e,l.getValue())}}window.onpagehide=R;window.beforeunload=R;let U=!1,T=!0;function w(e){if(l){U=!0,m.textContent=e,g("currentName",e),T=y.get(e)!=null;const n=T?y.get(e).substring(1):L(e)??"";window.location.hash="#"+e,l.setValue(n)}}function D(e){const n=document.createElement("div");n.classList.add("item");const t=document.createElement("button");n.appendChild(t),t.type="button",t.classList.add("blue","item");const o=document.createElement("span");return t.appendChild(o),o.textContent=e,t.onclick=function(){R(),w(o.textContent)},t.onkeyup=function(c){c.preventDefault()},t}function N(e){const n=document.createElement("button");return n.classList.add("icon"),e.parentElement.appendChild(n),n}function K(e){let n=1,t=e;for(;L(t)!=null||y.get(t)!=null;)t=e+" "+n++;return t}function _(e){const n=e.firstChild,t=N(e);t.classList.add("edit"),t.onclick=function(f){f.stopPropagation();const s=n.textContent,ee=L(s),v=document.createElement("form"),a=document.createElement("input");a.classList.add("name"),a.value=s,n.textContent="",e.appendChild(v),v.appendChild(a),a.focus(),a.setSelectionRange(0,s.length);function te(){const S=a.value;if(a.blur(),!S)return;const M=K(S);n.textContent=M,m.textContent==s&&(m.textContent=M),z(s),g(M,ee)}v.onsubmit=te,a.onclick=function(S){S.stopPropagation()},a.onblur=function(){e.removeChild(v),n.textContent=s}};const o=N(e);o.classList.add("trash");let c=0;o.onclick=function(f){if(f.stopPropagation(),e.classList.contains("blue"))c=performance.now(),e.classList.remove("blue"),e.classList.add("red"),document.body.addEventListener("click",function(){e.classList.add("blue"),e.classList.remove("red")},{once:!0});else if(performance.now()-c>500){z(n.textContent),m.textContent==n.textContent&&w("Intro");const s=e.parentElement;s.parentElement.removeChild(s)}}}const W=document.querySelector("#new");function B(e,n=void 0){const t=K(n??"New Script");g(t,e);const o=D(t);return W.insertAdjacentElement("afterend",o.parentElement),_(o),{button:o,name:t}}W.onclick=function(){B("").button.click()};const r=document.querySelector("#compile"),G=document.querySelector("#poster");let A=!1,x=!0;function J(){r.disabled=!1,x?r.click():G.textContent="Auto-run disabled"}let j;async function fe(){const e=await fetch("/manifold-global-types.d.ts").then(t=>t.text()),n=await fetch("/manifold-encapsulated-types.d.ts").then(t=>t.text());return` +${e.replaceAll("export","")} +${n.replace(/^import.*$/gm,"").replaceAll("export","declare")} +declare interface ManifoldToplevel { + CrossSection: typeof T.CrossSection; + Manifold: typeof T.Manifold; + Mesh: typeof T.Mesh; + triangulate: typeof T.triangulate; + setMinCircularAngle: typeof T.setMinCircularAngle; + setMinCircularEdgeLength: typeof T.setMinCircularEdgeLength; + setCircularSegments: typeof T.setCircularSegments; + getCircularSegments: typeof T.getCircularSegments; + setup: () => void; +} +declare const module: ManifoldToplevel; +`}async function me(){return`${(await fetch("/editor.d.ts").then(n=>n.text())).replace(/^import.*$/gm,"")}`}require.config({paths:{vs:"https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.34.0/min/vs"}});require(["vs/editor/editor.main"],async function(){monaco.languages.typescript.typescriptDefaults.addExtraLib(await fe()),monaco.languages.typescript.typescriptDefaults.addExtraLib(await me()),l=monaco.editor.create(document.getElementById("editor"),{language:"typescript",automaticLayout:!0}),j=await(await monaco.languages.typescript.getTypeScriptWorker())(l.getModel().uri),l.getModel().updateOptions({tabSize:2});for(const[t]of y){const o=D(t);I.appendChild(o.parentElement)}let n=m.textContent;for(let t=0;t0){const t=decodeURIComponent(window.location.hash.substring(1)),o=t.indexOf(q);if(o!=-1){x=!0;const c=t.substring(0,o);w(B(t.substring(o+q.length),c).name)}else t!=n&&(x=!0),w(t)}else w(n);A&&J(),l.onDidChangeModelContent(t=>{if(r.disabled=!1,U){U=!1,l.setScrollTop(0);return}if(T){const o=l.getPosition();B(l.getValue()).button.click(),l.setPosition(o)}}),window.onresize=()=>{l.layout({})}});const u=document.querySelector("model-viewer"),pe=document.querySelector("#animation"),b=document.querySelector("#play"),p=document.querySelector("#scrubber");let P=!1;u.addEventListener("load",()=>{const e=u.availableAnimations.length>0;pe.style.display=e?"flex":"none",e&&Q()});function Q(){u.play(),b.classList.remove("play"),b.classList.add("pause"),P=!1,p.classList.add("hide")}function ge(){u.pause(),b.classList.remove("pause"),b.classList.add("play"),P=!0,p.max=u.duration,p.value=u.currentTime,p.classList.remove("hide")}b.onclick=function(){P?Q():ge()};p.oninput=function(){u.currentTime=p.value};const d=document.querySelector("#console"),he=console.log;console.log=function(e){d.textContent+=e+`\r +`,d.scrollTop=d.scrollHeight,he(e)};function we(){d.textContent=""}function ye(){r.firstChild.style.visibility="hidden",r.classList.add("red","cancel")}function Ce(){r.firstChild.style.visibility="visible",r.classList.remove("red","cancel")}let X=performance.now();function Y(){Ce();const e=performance.now(),n=d.textContent;d.textContent=n.substring(n.indexOf(` +`)+1),console.log(`Took ${(Math.round((e-X)/10)/100).toLocaleString()} seconds`)}const i={glbURL:null,threeMFURL:null};let k=null;function O(){k=new ne,k.onmessage=function(e){if(e.data==null){j!=null&&!A&&J(),A=!0;return}if(e.data.log!=null){d.textContent+=e.data.log+`\r +`,d.scrollTop=d.scrollHeight;return}Y(),r.disabled=!0,i.threeMFURL!=null&&(URL.revokeObjectURL(i.threeMFURL),i.threeMFURL=null),URL.revokeObjectURL(i.glbURL),i.glbURL=e.data.glbURL,i.threeMFURL=e.data.threeMFURL,F.disabled=i.threeMFURL==null,u.src=i.glbURL,i.glbURL==null?(u.showPoster(),G.textContent="Error",O()):g("safe","true")}}O();async function Le(){R(),g("safe","false"),ye(),we(),console.log("Running...");const e=await j.getEmitOutput(l.getModel().uri.toString());k.postMessage(e.outputFiles[0].text),X=performance.now()}function be(){k.terminate(),O(),Y(),console.log("Run canceled")}r.onclick=function(){r.classList.contains("cancel")?be():Le()};function Z(e,n,t){const o=e.parentElement;return()=>{const c=$.firstElementChild;c!==o&&(h.insertBefore(c,h.firstElementChild),$.insertBefore(o,h),o.appendChild(E.parentElement));const f=document.createElement("a");f.download=n,f.href=i[t],f.click()}}const V=document.querySelector("#glb");V.onclick=Z(V,"manifold.glb","glbURL");const F=document.querySelector("#threemf");F.onclick=Z(F,"manifold.3mf","threeMFURL"); 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 vr(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 Br(){return Br=Object.assign||function(t){for(var e=1;es.dispose()),this[dr].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(xs(s)){const a=s;a.getChild()===e&&this.setRef(n,r,a.getAttributes())}else if($r(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(Pr(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[dr].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,Br({},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(Br({},e,{target:this})),this.graph.dispatchEvent(Br({},e,{target:this,type:`node:${e.type}`})),this}}const Da="v3.8.0",yr="@glb.bin";var X,In,rt,ht,Qt;(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"}(In||(In={})),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"}(rt||(rt={})),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"}(Qt||(Qt={}));const Sn={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};var vn,Ts=typeof Float32Array<"u"?Float32Array:Array;function us(t){return Math.hypot(t[0],t[1],t[2])}function Dh(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 $h(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=Ph(a,s.getWorldMatrix());Es(c.min,e),Es(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)}),vn=new Ts(3),Ts!=Float32Array&&(vn[0]=0,vn[1]=0,vn[2]=0);function Ph(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}},$a=class Pa{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 oe.decodeText(e.slice(12,16))===Pa.PNG_FRIED_CHUNK_NAME?[r.getUint32(32,!1),r.getUint32(36,!1)]:[r.getUint32(16,!1),r.getUint32(20,!1)]}getChannels(e){return 4}};$a.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 kh(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),kh(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 $a};let xr=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 na(t){return Object.prototype.toString.call(t)==="[object Object]"}function Jt(t){if(na(t)===!1)return!1;const e=t.constructor;if(e===void 0)return!0;const r=e.prototype;return na(r)!==!1&&Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")!==!1}var hs,ws;(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"})(ws||(ws={}));let er=class kr{constructor(e){this.verbosity=void 0,this.verbosity=e}debug(e){this.verbosity<=kr.Verbosity.DEBUG&&console.debug(e)}info(e){this.verbosity<=kr.Verbosity.INFO&&console.info(e)}warn(e){this.verbosity<=kr.Verbosity.WARN&&console.warn(e)}error(e){this.verbosity<=kr.Verbosity.ERROR&&console.error(e)}};function Uh(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],_=e[10],A=e[11],N=e[12],m=e[13],S=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*_+P*S,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*_+P*S,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*_+P*S,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*_+P*S,t[15]=R*c+b*g+O*A+P*T,t}hs=er,er.Verbosity=ws,er.DEFAULT_INSTANCE=new hs(hs.Verbosity.INFO);let Ne=class Ms{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 Ms.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 Ms.encodeNormalizedInt(e,r)}static decompose(e,r,n,s){let a=us([e[0],e[1],e[2]]);const c=us([e[4],e[5],e[6]]),f=us([e[8],e[9],e[10]]);var h,d,g,x,w,_,A,N,m,S,T,R,b,O,P,V,B;((d=(h=e)[0])*(A=h[5])-(g=h[1])*(_=h[4]))*((R=h[10])*(B=h[15])-(b=h[11])*(V=h[14]))-(d*(N=h[6])-(x=h[2])*_)*((T=h[9])*B-b*(P=h[13]))+(d*(m=h[7])-(w=h[3])*_)*(T*V-R*P)+(g*N-x*A)*((S=h[8])*B-b*(O=h[12]))-(g*m-w*A)*(S*V-R*O)+(x*m-w*N)*(S*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 Ts(3);(function(Ot,He){var xt=He[4],Ve=He[5],Ft=He[6],Zr=He[8],ir=He[9],Tt=He[10];Ot[0]=Math.hypot(He[0],He[1],He[2]),Ot[1]=Math.hypot(xt,Ve,Ft),Ot[2]=Math.hypot(Zr,ir,Tt)})(ee,U);var fe=1/ee[0],ie=1/ee[1],ge=1/ee[2],ve=U[0]*fe,xe=U[1]*ie,Te=U[2]*ge,Re=U[4]*fe,Ue=U[5]*ie,Ae=U[6]*ge,Ce=U[8]*fe,et=U[9]*ie,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-et)/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-et)/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+et)/Me):(Me=2*Math.sqrt(1+ot-ve-Ue),L[3]=(xe-Re)/Me,L[0]=(Ce+Te)/Me,L[1]=(Ae+et)/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,_=c*g,A=c*x,N=c*w,m=f*x,S=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-(_+T))*V,a[6]=(S+R)*V,a[7]=0,a[8]=(N+b)*B,a[9]=(S-R)*B,a[10]=(1-(_+m))*B,a[11]=0,a[12]=e[0],a[13]=e[1],a[14]=e[2],a[15]=1,a}};function Lh(t,e){if(!!t!=!!e)return!1;const r=t.getChild(),n=e.getChild();return r===n||r.equals(n)}function jh(t,e){if(!!t!=!!e||t.length!==e.length)return!1;for(let r=0;rt,Gh=new Set;let Us=class extends ks{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 vr)this[dr].has(n)||s.dispose();else if($r(s))for(const a of s)a.dispose();else if(Pr(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 vr)this[dr].has(n)?s.getChild().copy(r(a.getChild()),r):this.setRef(n,r(a.getChild()),a.getAttributes());else if($r(a))for(const c of a)this.addRef(n,r(c.getChild()),c.getAttributes());else if(Pr(a))for(const c in a){const f=a[c];this.setRefMap(n,c,r(f.getChild()),f.getAttributes())}else this[we][n]=Jt(a)?JSON.parse(JSON.stringify(a)):Array.isArray(a)||a instanceof ArrayBuffer||ArrayBuffer.isView(a)?a.slice():a}return this}equals(e,r=Gh){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(xs(s)||xs(a)){if(!Lh(s,a))return!1}else if($r(s)||$r(a)){if(!jh(s,a))return!1}else if(Pr(s)||Pr(a)){if(!Bh(s,a))return!1}else if(Jt(s)||Jt(a)){if(!Ua(s,a))return!1}else if(Cn(s)||Cn(a)){if(!ka(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 Us{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}},Wr=class qa extends Ke{init(){this.propertyType=X.PRIMITIVE}getDefaults(){return Object.assign(super.getDefaults(),{mode:qa.Mode.TRIANGLES,material:null,indices:null,attributes:{},targets:[]})}getIndices(){return this.getRef("indices")}setIndices(e){return this.setRef("indices",e,{usage:rt.ELEMENT_ARRAY_BUFFER})}getAttribute(e){return this.getRefMap("attributes",e)}setAttribute(e,r){return this.setRefMap("attributes",e,r,{usage:rt.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)}};Wr.Mode={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6};let qh=class extends Us{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:rt.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}},Xa=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:rt.INVERSE_BIND_MATRICES})}addJoint(e){return this.addRef("joints",e)}removeJoint(e){return this.removeRef("joints",e)}listJoints(){return this.listRefs("joints")}},Ya=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(xr.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(xr.extension(e));return r&&this.set("mimeType",r),this}getImage(){return this.get("image")}setImage(e){return this.set("image",oe.assertView(e))}getSize(){const e=this.get("image");return e?yt.getSize(e,this.getMimeType()):null}},Ka=class extends Ke{init(){this.propertyType=X.ROOT}getDefaults(){return Object.assign(super.getDefaults(),{asset:{generator:`glTF-Transform ${Da}`,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 Wa?this.addRef("scenes",e):e instanceof Ha?this.addRef("nodes",e):e instanceof Jr?this.addRef("cameras",e):e instanceof Xa?this.addRef("skins",e):e instanceof Ga?this.addRef("meshes",e):e instanceof Tr?this.addRef("materials",e):e instanceof Ya?this.addRef("textures",e):e instanceof La?this.addRef("animations",e):e instanceof te?this.addRef("accessors",e):e instanceof Ba&&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")}},js=class Mn{static fromGraph(e){return Mn.v.get(e)||null}constructor(){this.T=new Nh,this.S=new Ka(this.T),this.M=er.DEFAULT_INSTANCE,Mn.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 Mn().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 Wa(this.T,e)}createNode(e=""){return new Ha(this.T,e)}createCamera(e=""){return new Jr(this.T,e)}createSkin(e=""){return new Xa(this.T,e)}createMesh(e=""){return new Ga(this.T,e)}createPrimitive(){return new Wr(this.T)}createPrimitiveTarget(e=""){return new qh(this.T,e)}createMaterial(e=""){return new Tr(this.T,e)}createTexture(e=""){return new Ya(this.T,e)}createAnimation(e=""){return new La(this.T,e)}createAnimationChannel(e=""){return new Ls(this.T,e)}createAnimationSampler(e=""){return new jn(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 Ba(this.T,e)}};js.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 Wh=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 aa={logger:er.DEFAULT_INSTANCE,extensions:[],dependencies:{}};let Xh=class{static read(e,r=aa){const n=Ye({},aa,r),{json:s}=e,a=new js().setLogger(n.logger);this.validate(e,n);const c=new Wh(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]=oe.toView(b.uri?e.resources[b.uri]:e.resources[yr],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(En(T,c)),R});const _=s.images||[],A=s.textures||[];a.getRoot().listExtensionsUsed().filter(T=>T.prereadTypes.includes(X.TEXTURE)).forEach(T=>T.preread(c,X.TEXTURE)),c.textures=_.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[yr]).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=xr.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===Jr.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||jn.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 S=s.scenes||[];return a.getRoot().listExtensionsUsed().filter(T=>T.prereadTypes.includes(X.SCENE)).forEach(T=>T.preread(c,X.SCENE)),c.scenes=S.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=Sn[V.componentType],G=te.getElementSize(V.type);let H;H=V.bufferView!==void 0?En(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=En(U,B),ie=En(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 En(t,e){const r=e.bufferViews[t.bufferView],n=e.jsonDoc.json.bufferViews[t.bufferView],s=Sn[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=Sn[h.componentType],_=te.getElementSize(h.type),A=w.BYTES_PER_ELEMENT,N=h.byteOffset||0,m=new w(h.count*_),S=new DataView(g.buffer,g.byteOffset,g.byteLength),T=x.byteStride;for(let R=0;R1,()=>n.basename||"buffer"),this.imageURIGenerator=new oa(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===Qt.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 rt.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 rt.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=zr,ut.BufferViewUsage=rt,ut.USAGE_TO_TARGET={[rt.ARRAY_BUFFER]:zr.ARRAY_BUFFER,[rt.ELEMENT_ARRAY_BUFFER]:zr.ELEMENT_ARRAY_BUFFER};let oa=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:wn}=ut,{UNSIGNED_INT:Yh,UNSIGNED_SHORT:Kh,UNSIGNED_BYTE:Jh}=te.ComponentType;let Zh=class{static write(e,r){const n=e.getRoot(),s={asset:Ye({generator:`glTF-Transform ${Da}`},n.getAsset()),extras:Ye({},n.getExtras())},a={json:s,resources:{}},c=new ut(e,a,r),f=r.logger||er.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=Sn[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?Jh:P<65535?Kh:Yh,k={buffer:S,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=oe.pad(oe.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:S,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=oe.pad(oe.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 S=m.getChild();if(S instanceof te){const T=A.get(S)||[];T.push(m),A.set(S,T)}}if(s.accessors=[],s.bufferViews=[],s.samplers=[],s.textures=[],s.images=n.listTextures().map((m,S)=>{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,S),T}),d.filter(m=>m.prewriteTypes.includes(X.ACCESSOR)).forEach(m=>m.prewrite(c,X.ACCESSOR)),n.listAccessors().forEach(m=>{const S=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),S.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,S)=>{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!==wn.ARRAY_BUFFER||r.vertexLayout===In.INTERLEAVED){const U=H===wn.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===wn.ELEMENT_ARRAY_BUFFER?ut.BufferViewTarget.ELEMENT_ARRAY_BUFFER:void 0,U=H===wn.SPARSE?_(K,B,k):x(K,B,k,L);k+=U.byteLength,V.push(...U.buffers)}if(c.imageBufferViews.length&&S===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,S)=>{const T=c.createPropertyDef(m);if(m.getAlphaMode()!==Tr.AlphaMode.OPAQUE&&(T.alphaMode=m.getAlphaMode()),m.getAlphaMode()===Tr.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,S),T}),s.meshes=n.listMeshes().map((m,S)=>{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,S),T}),s.cameras=n.listCameras().map((m,S)=>{const T=c.createPropertyDef(m);if(T.type=m.getType(),T.type===Jr.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,S),T}),s.nodes=n.listNodes().map((m,S)=>{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,S),T}),s.skins=n.listSkins().map((m,S)=>{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,S),T}),n.listNodes().forEach((m,S)=>{const T=s.nodes[S],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,S)=>{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,S),T}),s.scenes=n.listScenes().map((m,S)=>{const T=c.createPropertyDef(m);return T.nodes=m.listChildren().map(R=>c.nodeIndexMap.get(R)),c.sceneIndexMap.set(m,S),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 S=[];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)&&S.push(T)}for(const T of S)delete m[T]}(s),a}};var Nn;(function(t){t[t.JSON=1313821514]="JSON",t[t.BIN=5130562]="BIN"})(Nn||(Nn={}));let Qh=class{constructor(){this.M=er.DEFAULT_INSTANCE,this.l=new Set,this.U={},this.P=In.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=ca(r)?this.L(r):{json:JSON.parse(oe.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),Xh.read(e,{extensions:Array.from(this.l),dependencies:this.U,logger:this.M})}async binaryToJSON(e){const r=this.L(oe.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(oe.assertView(e)))}async writeJSON(e,r={}){if(r.format===Qt.GLB&&e.getRoot().listBuffers().length>1)throw new Error("GLB must have 0–1 buffers.");return Zh.write(e,{format:r.format||Qt.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:Qt.GLB}),s=new Uint32Array([1179937895,2,12]),a=JSON.stringify(r),c=oe.pad(oe.encodeText(a),32),f=oe.toView(new Uint32Array([c.byteLength,1313821514])),h=oe.concat([f,c]);s[s.length-1]+=h.byteLength;const d=Object.values(n)[0];if(!d||!d.byteLength)return oe.concat([oe.toView(s),h]);const g=oe.pad(d,0),x=oe.toView(new Uint32Array([g.byteLength,5130562])),w=oe.concat([x,g]);return s[s.length-1]+=w.byteLength,oe.concat([oe.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)oe.assertView(e.resources[n.uri]);else if(n.uri.match(/data:/)){const s=`__${zh()}.${xr.extension(n.uri)}`;e.resources[s]=oe.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(!ca(e))throw new Error("Invalid glTF 2.0 binary.");const r=new Uint32Array(e.buffer,e.byteOffset+12,2);if(r[1]!==Nn.JSON)throw new Error("Missing required GLB JSON chunk.");const n=r[0],s=oe.decodeText(oe.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]!==Nn.BIN)throw new Error("Expected GLB BIN in second chunk.");const h=oe.toView(e,c+8,f[0]);return{json:a,resources:{[yr]:h}}}};function ca(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 ed=class extends Qh{constructor(e=Vr.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 Vr.resolve(e,r)}dirname(e){return Vr.dirname(e)}};const td=0,rd=0,nd=0,sd=2,id=0,ad=163,od=166,cd=0,ld=2,fd=1,ud=64,hd=0;class dd{constructor(){this.vkFormat=hd,this.typeSize=1,this.pixelWidth=0,this.pixelHeight=0,this.pixelDepth=0,this.layerCount=0,this.faceCount=1,this.supercompressionScheme=td,this.levels=[],this.dataFormatDescriptor=[{vendorId:nd,descriptorType:rd,descriptorBlockSize:0,versionNumber:sd,colorModel:id,colorPrimaries:fd,transferFunction:ld,flags:cd,texelBlockDimension:[0,0,0,0],bytesPlane:[0,0,0,0,0,0,0,0],samples:[]}],this.keyValue={},this.globalData=null}}class Nr{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(bs);for(const r of this.properties)for(const n of r.listAttributes())e.addAccessorToUsageGroup(n,bs);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?fa:pd,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;gps(h,t.getComponentType())),c.max=c.max.map(h=>ps(h,t.getComponentType()))),c.normalized&&(c.min=c.min.map(h=>ua(h,c.componentType)),c.max=c.max.map(h=>ua(h,c.componentType)))}else c.byteStride%4&&(c.array=function(f,h){const d=oe.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 Wr&&r.getMode()===Wr.Mode.TRIANGLES)?gr.TRIANGLES:gr.INDICES:gr.ATTRIBUTES}function yd(t,e){const r=e.getGraph().listParentEdges(t).filter(n=>!(n.getParent()instanceof Ka));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=eo(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 eo(t){for(const e of t.listParents())if(e instanceof jn){for(const r of e.listParents())if(r instanceof Ls)return r.getTargetPath()}return null}const Xe=Rs,ha={method:Xr.QUANTIZE};class As 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=ha,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({},ha,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=oe.toView(x.uri?r.resources[x.uri]:r.resources[yr],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[Rs]&&s.extensions[Rs].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(eo(f)==="weights"||f.getSparse())continue;const h=e.getAccessorUsage(f),d=vd(f,h),g=s.method===Xr.FILTER?yd(f,this.document):{filter:De.NONE},x=md(f,n,d,g),{array:w,byteStride:_}=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,_,N].join(":");let S=this._encoderBufferViews[m],T=this._encoderBufferViewData[m],R=this._encoderBufferViewAccessors[m];S&&T||(R=this._encoderBufferViewAccessors[m]=[],T=this._encoderBufferViewData[m]=[],S=this._encoderBufferViews[m]={buffer:c,target:ut.USAGE_TO_TARGET[h],byteOffset:0,byteLength:0,byteStride:h===ut.BufferViewUsage.ARRAY_BUFFER?_:void 0,extensions:{[Xe]:{buffer:N,byteOffset:0,byteLength:0,mode:d,filter:g.filter!==De.NONE?g.filter:void 0,byteStride:_,count:0}}});const b=e.createAccessorDef(f);b.componentType=x.componentType,b.normalized=x.normalized,b.byteOffset=S.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)),S.byteLength+=w.byteLength,S.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=oe.concat(a),w=r.encodeGltfBuffer(x,h,d,g),_=oe.pad(w);s.extensions[Xe].byteLength=w.byteLength,a.length=0,a.push(_),f.push(_),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+=oe.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}}As.EXTENSION_NAME=Xe,As.EncoderMethod=Xr;const Ur="EXT_texture_avif";class xd{match(e){return e.length>=12&&oe.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=da(r,0);if(!n)return null;let s=n.end;for(;n=da(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 to extends Se{constructor(...e){super(...e),this.extensionName=Ur,this.prereadTypes=[X.TEXTURE]}static register(){yt.registerFormat("image/avif",new xd)}preread(e){return(e.jsonDoc.json.textures||[]).forEach(r=>{r.extensions&&r.extensions[Ur]&&(r.source=r.extensions[Ur].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[Ur]={source:a.source},delete a.source)})}}),this}}function da(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=oe.decodeText(e.slice(0,4)),n=oe.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 ro extends Se{constructor(...e){super(...e),this.extensionName=Lr,this.prereadTypes=[X.TEXTURE]}static register(){yt.registerFormat("image/webp",new Td)}preread(e){return(e.jsonDoc.json.textures||[]).forEach(r=>{r.extensions&&r.extensions[Lr]&&(r.source=r.extensions[Lr].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[Lr]={source:a.source},delete a.source)})}}),this}}ro.EXTENSION_NAME=Lr;const pa=Ja;let Le,no,so,it;function Ed(t,e){const r=new Le.DecoderBuffer;try{if(r.Init(e,e.length),t.GetEncodedGeometryType(r)!==Le.TRIANGULAR_MESH)throw new Error(`[${pa}] Unknown geometry type.`);const n=new Le.Mesh;if(!t.DecodeBufferToMesh(r,n).ok()||n.ptr===0)throw new Error(`[${pa}] Decoding failure.`);return n}finally{Le.destroy(r)}}function wd(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 Md(t,e,r,n){const s=so[n.componentType],a=no[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 Yr,at;(function(t){t[t.EDGEBREAKER=1]="EDGEBREAKER",t[t.SEQUENTIAL=0]="SEQUENTIAL"})(Yr||(Yr={})),function(t){t.POSITION="POSITION",t.NORMAL="NORMAL",t.COLOR="COLOR",t.TEX_COORD="TEX_COORD",t.GENERIC="GENERIC"}(at||(at={}));const io={[at.POSITION]:14,[at.NORMAL]:10,[at.COLOR]:8,[at.TEX_COORD]:12,[at.GENERIC]:12},ga={decodeSpeed:5,encodeSpeed:5,method:Yr.EDGEBREAKER,quantizationBits:io,quantizationVolume:"mesh"};function _d(t,e=ga){const r=At({},ga,e);r.quantizationBits=At({},io,e.quantizationBits);const n=new it.MeshBuilder,s=new it.Mesh,a=new it.ExpertEncoder(s),c={},f=new it.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 S=Rd(N),T=bd(n,m.getComponentType(),s,it[S],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[S]);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[S],m.getElementSize(),R.min,b)}}}const g=t.getIndices();if(!g)throw new Is("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===Yr.SEQUENTIAL||h||d?it.MESH_SEQUENTIAL_ENCODING:it.MESH_EDGEBREAKER_ENCODING);const x=a.EncodeToDracoBuffer(!(h||d),f);if(x<=0)throw new Is("Error applying Draco compression.");const w=new Uint8Array(x);for(let N=0;NT.propertyType));if(S.size!==2||!S.has(X.PRIMITIVE)||!S.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 S=N.get(m),T=m.getIndices();if(_.get(T)!==S||m.listAttributes().some(R=>_.get(R)!==S))throw new Error(`[${Fe}] Draco primitives must share all, or no, accessors.`)}for(const m of Array.from(g)){const S=m.getIndices();if(_.has(S)||m.listAttributes().some(T=>_.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=$h(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=_d(f,At({},this._encoderOptions,{quantizationVolume:c}))}catch(A){if(A instanceof Is){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 _=f.getAttribute("POSITION").getBuffer()||this.document.getRoot().listBuffers()[0];e.otherBufferViews.has(_)||e.otherBufferViews.set(_,[]),e.otherBufferViews.get(_).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 ma(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("|")}Ss.EXTENSION_NAME=Fe,Ss.EncoderMethod=Yr;class Er extends $e{init(){this.extensionName=Vs,this.propertyType="Light",this.parentTypes=[X.NODE]}getDefaults(){return Object.assign(super.getDefaults(),{color:[1,1,1],intensity:1,type:Er.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)}}Er.EXTENSION_NAME=Vs,Er.Type={POINT:"point",SPOT:"spot",DIRECTIONAL:"directional"};const gt=Vs;class ao extends Se{constructor(...e){super(...e),this.extensionName=gt}createLight(e=""){return new Er(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()===Er.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}}ao.EXTENSION_NAME=gt;const{R:Ad,G:Id,B:Sd}=ht;class oo extends $e{init(){this.extensionName=zs,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:Ad|Id|Sd})}}oo.EXTENSION_NAME=zs;const Lt=zs;class co extends Se{constructor(...e){super(...e),this.extensionName=Lt}createAnisotropy(){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[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}}co.EXTENSION_NAME=Lt;const{R:va,G:ya,B:Cd}=ht;class lo extends $e{init(){this.extensionName=Gs,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:va})}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:ya})}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:va|ya|Cd})}}lo.EXTENSION_NAME=Gs;const jt=Gs;class fo extends Se{constructor(...e){super(...e),this.extensionName=jt}createClearcoat(){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[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}}fo.EXTENSION_NAME=jt;class uo extends $e{init(){this.extensionName=Hs,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)}}uo.EXTENSION_NAME=Hs;const Bt=Hs;class ho extends Se{constructor(...e){super(...e),this.extensionName=Bt}createEmissiveStrength(){return new uo(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}}ho.EXTENSION_NAME=Bt;class po extends $e{init(){this.extensionName=qs,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)}}po.EXTENSION_NAME=qs;const Vt=qs;class go extends Se{constructor(...e){super(...e),this.extensionName=Vt}createIOR(){return new po(this.document.getGraph())}read(e){return(e.jsonDoc.json.materials||[]).forEach((r,n)=>{if(r.extensions&&r.extensions[Vt]){const s=this.createIOR();e.materials[n].setExtension(Vt,s);const a=r.extensions[Vt];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(Vt);if(s){const a=e.materialIndexMap.get(n),c=r.json.materials[a];c.extensions=c.extensions||{},c.extensions[Vt]={ior:s.getIOR()}}}),this}}go.EXTENSION_NAME=Vt;const{R:Nd,G:Od}=ht;class mo extends $e{init(){this.extensionName=Ws,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:Nd})}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:Od})}}mo.EXTENSION_NAME=Ws;const zt=Ws;class vo extends Se{constructor(...e){super(...e),this.extensionName=zt}createIridescence(){return new mo(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[zt]){const c=this.createIridescence();e.materials[a].setExtension(zt,c);const f=s.extensions[zt];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(zt);if(s){const a=e.materialIndexMap.get(n),c=r.json.materials[a];c.extensions=c.extensions||{};const f=c.extensions[zt]={};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}}vo.EXTENSION_NAME=zt;const{R:xa,G:Ta,B:Ea,A:wa}=ht;class yo extends $e{init(){this.extensionName=Xs,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:xa|Ta|Ea|wa,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:xa|Ta|Ea|wa})}}yo.EXTENSION_NAME=Xs;const Gt=Xs;class xo extends Se{constructor(...e){super(...e),this.extensionName=Gt}createPBRSpecularGlossiness(){return new yo(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}}xo.EXTENSION_NAME=Gt;const{R:Fd,G:Dd,B:$d,A:Pd}=ht;class To extends $e{init(){this.extensionName=Ys,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:Fd|Dd|$d,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:Pd})}}To.EXTENSION_NAME=Ys;const Ht=Ys;class Eo extends Se{constructor(...e){super(...e),this.extensionName=Ht}createSheen(){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[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}}Eo.EXTENSION_NAME=Ht;const{R:kd,G:Ud,B:Ld,A:jd}=ht;class wo extends $e{init(){this.extensionName=Ks,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:jd})}getSpecularColorTexture(){return this.getRef("specularColorTexture")}getSpecularColorTextureInfo(){return this.getRef("specularColorTexture")?this.getRef("specularColorTextureInfo"):null}setSpecularColorTexture(e){return this.setRef("specularColorTexture",e,{channels:kd|Ud|Ld,isColor:!0})}}wo.EXTENSION_NAME=Ks;const qt=Ks;class Mo extends Se{constructor(...e){super(...e),this.extensionName=qt}createSpecular(){return new wo(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}}Mo.EXTENSION_NAME=qt;const{R:Bd}=ht;class _o extends $e{init(){this.extensionName=Js,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:Bd})}}_o.EXTENSION_NAME=Js;const Wt=Js;class Ro extends Se{constructor(...e){super(...e),this.extensionName=Wt}createTransmission(){return new _o(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}}Ro.EXTENSION_NAME=Wt;class bo extends $e{init(){this.extensionName=Zs,this.propertyType="Unlit",this.parentTypes=[X.MATERIAL]}}bo.EXTENSION_NAME=Zs;const hr=Zs;class ti extends Se{constructor(...e){super(...e),this.extensionName=hr}createUnlit(){return new bo(this.document.getGraph())}read(e){return(e.jsonDoc.json.materials||[]).forEach((r,n)=>{r.extensions&&r.extensions[hr]&&e.materials[n].setExtension(hr,this.createUnlit())}),this}write(e){const r=e.jsonDoc;return this.document.getRoot().listMaterials().forEach(n=>{if(n.getExtension(hr)){const s=e.materialIndexMap.get(n),a=r.json.materials[s];a.extensions=a.extensions||{},a.extensions[hr]={}}}),this}}ti.EXTENSION_NAME=hr;class Ao extends $e{init(){this.extensionName=sr,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")}}Ao.EXTENSION_NAME=sr;class Io extends $e{init(){this.extensionName=sr,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")}}Io.EXTENSION_NAME=sr;class Cs extends $e{init(){this.extensionName=sr,this.propertyType="Variant",this.parentTypes=["MappingList"]}}Cs.EXTENSION_NAME=sr;const mt=sr;class So extends Se{constructor(...e){super(...e),this.extensionName=mt}createMappingList(){return new Io(this.document.getGraph())}createVariant(e=""){return new Cs(this.document.getGraph(),e)}createMapping(){return new Ao(this.document.getGraph())}listVariants(){return Array.from(this.properties).filter(e=>e instanceof Cs)}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 _ of x.variants||[])w.addVariant(n[_]);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(_=>{const A=e.createPropertyDef(_),N=_.getMaterial();return N&&(A.material=e.materialIndexMap.get(N)),A.variants=_.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}}So.EXTENSION_NAME=mt;const{G:Vd}=ht;class Co extends $e{init(){this.extensionName=Qs,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:Vd})}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))}}Co.EXTENSION_NAME=Qs;const Xt=Qs;class No extends Se{constructor(...e){super(...e),this.extensionName=Xt}createVolume(){return new Co(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}}No.EXTENSION_NAME=Xt;const Oo="KHR_mesh_quantization";class Fo extends Se{constructor(...e){super(...e),this.extensionName=Oo}read(e){return this}write(e){return this}}Fo.EXTENSION_NAME=Oo;const jr="KHR_texture_basisu";class zd{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=ds(e);return[r.pixelWidth,r.pixelHeight]}getChannels(e){const r=ds(e).dataFormatDescriptor[0];if(r.colorModel===ad)return r.samples.length===2&&(15&r.samples[1].channelType)==15?4:3;if(r.colorModel===od)return(15&r.samples[0].channelType)==3?4:3;throw new Error(`Unexpected KTX2 colorModel, "${r.colorModel}".`)}getVRAMByteLength(e){const r=ds(e),n=this.getChannels(e)>3;let s=0;for(let a=0;a{r.extensions&&r.extensions[jr]&&(r.source=r.extensions[jr].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[jr]={source:a.source},delete a.source)})}}),this}}Do.EXTENSION_NAME=jr;class $o extends $e{init(){this.extensionName=ei,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)}}$o.EXTENSION_NAME=ei;const Yt=ei;class Po extends Se{constructor(...e){super(...e),this.extensionName=Yt}createTransform(){return new $o(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}}Po.EXTENSION_NAME=Yt;const Gd=[X.ROOT,X.SCENE,X.NODE,X.MESH,X.MATERIAL,X.TEXTURE,X.ANIMATION];class ko extends $e{init(){this.extensionName=On,this.propertyType="Packet",this.parentTypes=Gd}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":gs(this.get("context"))},gs(this.get("properties")))}fromJSONLD(e){const r=(e=gs(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(`${On}: Missing context for term, "${e}".`)}}function gs(t){return JSON.parse(JSON.stringify(t))}ko.EXTENSION_NAME=On;const bt=On;class Uo extends Se{constructor(...e){super(...e),this.extensionName=bt}createPacket(){return new ko(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}}Uo.EXTENSION_NAME=bt;const Lo=[Ss,ao,co,fo,ho,go,vo,xo,Mo,Eo,Ro,ti,So,No,Fo,Do,Po,Uo];[...Lo];const jo=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],Bo=t=>{let e="";for(let r=0;r<16;r++)r%4!=3&&(r>0&&(e+=" "),e+=t[r]||0);return e},Hd=(t=1,e=jo)=>` +`,Ma=t=>t?t.toISOString().substring(0,10):"";function qd(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} + + ${Ma(c)} + ${Ma(h||c)} + ${a} + `)}function Wd(t,e,r,n){t.push(` +`),t.push(` +`),r.forEach(({objectID:s,transform:a})=>{Xd(t,s,a)}),t.push(` +`),t.push(` +`)}const Xd=(t,e=1,r=jo)=>{t.push(` +`)};function Yd(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 _a={name:"[Content_Types].xml",content:` + + + + +`};function Kd({meshes:t=[],components:e=[],items:r=[],precision:n=17,header:s}){const a=[];return qd(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})=>Yd(a,c,f,h,n,d)),e.forEach(({id:c,children:f,name:h})=>{Wd(a,c,f,h)}),a.push(` +`),a.push(` +`),r.forEach(({objectID:c,transform:f})=>{a.push(Hd(c,f))}),a.push(` +`),a.push(` +`),a.join("")}class Jd{constructor(){this.idSeq=0,this.lines=['','']}get name(){return"_rels/.rels"}addRel(e,r){this.lines.push(` `)}add3dModel(e){this.addRel(e,"http://schemas.microsoft.com/3dmanufacturing/2013/01/3dmodel")}addThumbnail(e){this.addRel(e,"http://schemas.openxmlformats.org/package/2006/relationships/metadata/thumbnail")}get content(){return this.lines.join(` +`)+` +`}}var Ge=Uint8Array,tt=Uint16Array,ri=Int32Array,ni=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]),si=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]),Ra=new Ge([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Vo=function(t,e){for(var r=new tt(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,Os[be]=((Nt&65280)>>8|(Nt&255)<<8)>>1}var Gr=function(t,e,r){for(var n=t.length,s=0,a=new tt(e);s>h]=d}else for(f=new tt(n),s=0;s>15-t[s]);return f},rr=new Ge(288);for(var be=0;be<144;++be)rr[be]=8;for(var be=144;be<256;++be)rr[be]=9;for(var be=256;be<280;++be)rr[be]=7;for(var be=280;be<288;++be)rr[be]=8;var Fn=new Ge(32);for(var be=0;be<32;++be)Fn[be]=5;var ep=Gr(rr,9,0),tp=Gr(Fn,5,0),Go=function(t){return(t+7)/8|0},Ho=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},rp=["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"],Bn=function(t,e,r){var n=new Error(e||rp[t]);if(n.code=t,Error.captureStackTrace&&Error.captureStackTrace(n,Bn),!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},Or=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},ms=function(t,e){for(var r=[],n=0;nw&&(w=a[n].s);var _=new tt(w+1),A=Fs(r[g-1],_,0);if(A>e){var n=0,N=0,m=A-e,S=1<e)N+=S-(1<>=m;N>0;){var R=a[n].s;_[R]=0&&N;--n){var b=a[n].s;_[b]==e&&(--_[b],++N)}A=e}return{t:new Ge(_),l:A}},Fs=function(t,e,r){return t.s==-1?Math.max(Fs(t.l,e,r+1),Fs(t.r,e,r+1)):e[t.s]=r},Aa=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new tt(++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}},Fr=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[Ra[K-1]];--K);var L=d+5<<3,U=Fr(s,rr)+Fr(a,Fn)+c,ee=Fr(s,w)+Fr(a,N)+c+14+3*K+Fr(V,G)+2*V[16]+3*V[17]+7*V[18];if(h>=0&&L<=U&&L<=ee)return qo(e,g,t.subarray(h,h+d));var fe,ie,ge,ve;if(Rt(e,g,1+(ee15&&(Rt(e,g,Ue[B]>>5&127),g+=Ue[B]>>12)}}else fe=ep,ie=rr,ge=tp,ve=Fn;for(var B=0;B255){var Ae=Ce>>18&31;Or(e,g,fe[Ae+257]),g+=ie[Ae+257],Ae>7&&(Rt(e,g,Ce>>23&31),g+=ni[Ae]);var et=Ce&31;Or(e,g,ge[et]),g+=ve[et],et>3&&(Or(e,g,Ce>>5&8191),g+=si[et])}else Or(e,g,fe[Ce]),g+=ie[Ce]}return Or(e,g,fe[256]),g+ie[256]},np=new ri([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Wo=new Ge(0),sp=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=np[e-1],w=x>>13,_=x&8191,A=(1<7e3||G>24576)&&(fe>423||!d)){g=Ia(t,h,0,b,O,P,B,G,K,k-K,g),G=V=B=0,K=k;for(var ie=0;ie<286;++ie)O[ie]=0;for(var ie=0;ie<30;++ie)P[ie]=0}var ge=2,ve=0,xe=_,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 et=Math.min(Te,Ce-2),ot=0,ie=0;ieot&&(ot=Ot,ee=Je)}}}U=ee,ee=N[U],Te+=U-ee&32767}if(ve){b[G++]=268435456|Ns[ge]<<18|ba[ve];var He=Ns[ge]&31,xt=ba[ve]&31;B+=ni[He]+si[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,Ve=c),g=qo(h,g+1,t.subarray(k,Ve))}a.i=c}return Ho(f,0,n+Go(g)+s)},ip=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}(),ap=function(){var t=-1;return{p:function(e){for(var r=t,n=0;n>>8;t=r},d:function(){return~t}}},op=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 sp(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)},Xo=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},ze=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8};function cp(t,e){return op(t,e||{},0,0)}var Yo=function(t,e,r,n){for(var s in t){var a=t[s],c=e+s,f=n;Array.isArray(a)&&(f=Xo(n,a[1]),a=a[0]),a instanceof Ge?r[c]=[a,f]:(r[c+="/"]=[new Ge(0),f],Yo(a,c,r,n))}},Sa=typeof TextEncoder<"u"&&new TextEncoder,lp=typeof TextDecoder<"u"&&new TextDecoder,fp=0;try{lp.decode(Wo,{stream:!0}),fp=1}catch{}function Hr(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 Ho(a,0,c)}var Ds=function(t){var e=0;if(t)for(var r in t){var n=t[r].length;n>65535&&Bn(9),e+=n+4}return e},Ca=function(t,e,r,n,s,a,c,f){var h=n.length,d=r.extra,g=f&&f.length,x=Ds(d);ze(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),_=w.getFullYear()-1980;if((_<0||_>119)&&Bn(10),ze(t,e,_<<25|w.getMonth()+1<<21|w.getDate()<<16|w.getHours()<<11|w.getMinutes()<<5|w.getSeconds()>>1),e+=4,a!=-1&&(ze(t,e,r.crc),ze(t,e+4,a<0?-a-2:a),ze(t,e+8,r.size)),ze(t,e+12,h),ze(t,e+14,x),e+=16,c!=null&&(ze(t,e,g),ze(t,e+6,r.attrs),ze(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;ze(t,e,+A),ze(t,e+2,m),t.set(N,e+4),e+=4+m}return g&&(t.set(f,e),e+=g),e},up=function(t,e,r,n,s){ze(t,e,101010256),ze(t,e+8,r),ze(t,e+10,r),ze(t,e+12,n),ze(t,e+16,s)};function hp(t,e){e||(e={});var r={},n=[];Yo(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=Hr(c),w=x.length,_=d.comment,A=_&&Hr(_),N=A&&A.length,m=Ds(d.extra);w>65535&&Bn(11);var S=g?cp(h,d):h,T=S.length,R=ap();R.p(h),n.push(Xo(d,{size:h.length,crc:R.d(),c:S,f:x,m:A,u:w!=c.length||A&&_.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),ac(t,e,r),t}function oc(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function cc(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 lc(t,e){var r=new le(3);cc(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,_=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,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,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=Math.sqrt(1+A-c-g)*2,t[3]=(f-d)/m,t[0]=(w+h)/m,t[1]=(x+_)/m,t[2]=.25*m),t}function f1(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,_=s*g,A=a*d,N=a*g,m=c*g,S=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]=(_-T)*b,t[3]=0,t[4]=(w-R)*O,t[5]=(1-(x+m))*O,t[6]=(N+S)*O,t[7]=0,t[8]=(_+T)*P,t[9]=(N-S)*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 u1(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,_=a*g,A=a*x,N=c*g,m=c*x,S=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+S))*O,K=(_+b)*O,L=(A-R)*O,U=(_-b)*P,ee=(1-(w+S))*P,fe=(m+T)*P,ie=(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]=ie,t[9]=ge,t[10]=ve,t[11]=0,t[12]=r[0]+B-(H*B+U*k+ie*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 h1(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,_=s*f,A=s*h,N=a*c,m=a*f,S=a*h;return t[0]=1-x-A,t[1]=g+S,t[2]=w-m,t[3]=0,t[4]=g-S,t[5]=1-d-A,t[6]=_+N,t[7]=0,t[8]=w+m,t[9]=_-N,t[10]=1-d-x,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function d1(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 fc(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 p1=fc;function g1(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 m1(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 uc(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 v1=uc;function y1(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 x1(t,e,r,n){var s,a,c,f,h,d,g,x,w,_,A=e[0],N=e[1],m=e[2],S=n[0],T=n[1],R=n[2],b=r[0],O=r[1],P=r[2];return Math.abs(A-b)0&&(_=1/Math.sqrt(_),g*=_,x*=_,w*=_);var A=h*w-d*x,N=d*g-f*w,m=f*x-h*g;return _=A*A+N*N+m*m,_>0&&(_=1/Math.sqrt(_),A*=_,N*=_,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 w1(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 M1(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 hc(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 _1(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 R1(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 b1(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],_=t[11],A=t[12],N=t[13],m=t[14],S=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],ie=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(_-L)<=Q*Math.max(1,Math.abs(_),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(S-ie)<=Q*Math.max(1,Math.abs(S),Math.abs(ie))}var I1=ic,S1=hc,C1=Object.freeze({__proto__:null,add:M1,adjoint:Yg,clone:zg,copy:Gg,create:Vg,determinant:Kg,equals:A1,exactEquals:b1,frob:w1,fromQuat:h1,fromQuat2:l1,fromRotation:i1,fromRotationTranslation:ac,fromRotationTranslationScale:f1,fromRotationTranslationScaleOrigin:u1,fromScaling:s1,fromTranslation:n1,fromValues:Hg,fromXRotation:a1,fromYRotation:o1,fromZRotation:c1,frustum:d1,getRotation:lc,getScaling:cc,getTranslation:oc,identity:sc,invert:Xg,lookAt:x1,mul:I1,multiply:ic,multiplyScalar:_1,multiplyScalarAndAdd:R1,ortho:v1,orthoNO:uc,orthoZO:y1,perspective:p1,perspectiveFromFieldOfView:m1,perspectiveNO:fc,perspectiveZO:g1,rotate:Qg,rotateX:e1,rotateY:t1,rotateZ:r1,scale:Zg,set:qg,str:E1,sub:S1,subtract:hc,targetTo:T1,translate:Jg,transpose:Wg});function ii(){var t=new le(3);return le!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function N1(t){var e=new le(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function dc(t){var e=t[0],r=t[1],n=t[2];return Math.hypot(e,r,n)}function $s(t,e,r){var n=new le(3);return n[0]=t,n[1]=e,n[2]=r,n}function O1(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function F1(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 pc(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}function gc(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t}function mc(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t}function $1(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}function P1(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}function k1(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 U1(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 L1(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t}function j1(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}function B1(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 vc(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 yc(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 xc(t){var e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n}function V1(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function z1(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}function Tc(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 ai(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function _n(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 G1(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 H1(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 q1(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 W1(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 X1(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 Y1(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 K1(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,_=s*w-a*x,A=a*g-n*w,N=n*x-s*g,m=c*2;return g*=m,x*=m,w*=m,_*=2,A*=2,N*=2,t[0]=f+g+_,t[1]=h+x+A,t[2]=d+w+N,t}function J1(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 Z1(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 Q1(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 e0(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&&ai(t,e)/g;return Math.acos(Math.min(Math.max(x,-1),1))}function t0(t){return t[0]=0,t[1]=0,t[2]=0,t}function r0(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"}function n0(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function s0(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 i0=pc,a0=gc,o0=mc,c0=vc,l0=yc,Ec=dc,f0=xc,u0=function(){var t=ii();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 $c(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],_=e[3];return t[0]=x*d-w*h+_*f,t[1]=-(g*d)+w*c-_*a,t[2]=g*h-x*c+_*s,t[3]=-(g*f)+x*a-w*s,t}function Pc(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 w0(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 M0(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 _0(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,_=-c*n-f*s-h*a;return t[0]=g*d+_*-c+x*-h-w*-f,t[1]=x*d+_*-f+w*-c-g*-h,t[2]=w*d+_*-h+g*-f-x*-c,t[3]=e[3],t}function R0(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}function b0(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function kc(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function Uc(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=Ic,I0=Sc,S0=Cc,C0=Oc,N0=Fc,O0=oi,F0=ci,D0=function(){var t=wc();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 U0(t,e){var r=fi(t,e);return Math.acos(2*r*r-1)}function jc(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 Bc(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 Vc(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 zc(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 L0(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 Gc(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 Hc(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 j0(t,e,r){return Hc(t,e),Wc(t,t,r),Gc(t,t),t}function Rn(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,_,A,N,m;return _=s*h+a*d+c*g+f*x,_<0&&(_=-_,h=-h,d=-d,g=-g,x=-x),1-_>Q?(w=Math.acos(_),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 B0(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 V0(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 z0(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function qc(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 G0(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 H0(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}var q0=Mc,W0=_c,li=Rc,X0=bc,Y0=Ac,K0=jc,Wc=Nc,fi=$c,J0=Pc,ui=oi,Z0=ui,hi=ci,Q0=hi,di=Dc,em=kc,tm=Uc,rm=function(){var t=ii(),e=$s(1,0,0),r=$s(0,1,0);return function(n,s,a){var c=ai(s,a);return c<-.999999?(_n(t,e,s),Ec(t)<1e-6&&_n(t,r,s),Tc(t,t),Lc(n,t,Math.PI),n):c>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(_n(t,s,a),n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=1+c,di(n,n))}}(),nm=function(){var t=Dn(),e=Dn();return function(r,n,s,a,c,f){return Rn(t,n,c,f),Rn(e,s,a,f),Rn(r,t,e,2*f*(1-f)),r}}(),sm=function(){var t=tc();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],di(e,qc(e,t))}}(),im=Object.freeze({__proto__:null,add:Y0,calculateW:L0,clone:q0,conjugate:z0,copy:li,create:Dn,dot:fi,equals:tm,exactEquals:em,exp:Gc,fromEuler:G0,fromMat3:qc,fromValues:W0,getAngle:U0,getAxisAngle:k0,identity:P0,invert:V0,len:Z0,length:ui,lerp:J0,ln:Hc,mul:K0,multiply:jc,normalize:di,pow:j0,random:B0,rotateX:Bc,rotateY:Vc,rotateZ:zc,rotationTo:rm,scale:Wc,set:X0,setAxes:sm,setAxisAngle:Lc,slerp:Rn,sqlerp:nm,sqrLen:Q0,squaredLength:hi,str:H0});function am(){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 om(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 cm(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 lm(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 Xc(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 fm(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 um(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 hm(t,e){var r=Dn();lc(r,e);var n=new le(3);return oc(n,e),Xc(t,r,n),t}function Yc(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 dm(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 pm(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 gm=li;function mm(t,e){return t[0]=e[4],t[1]=e[5],t[2]=e[6],t[3]=e[7],t}var vm=li;function ym(t,e){return t[4]=e[0],t[5]=e[1],t[6]=e[2],t[7]=e[3],t}function xm(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 Tm(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],_=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+_,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,_=d*c+g*a+f*s-h*n,A=g*c-f*n-h*s-d*a;return Bc(t,e,r),n=t[0],s=t[1],a=t[2],c=t[3],t[4]=x*c+A*n+w*a-_*s,t[5]=w*c+A*s+_*n-x*a,t[6]=_*c+A*a+x*s-w*n,t[7]=A*c-x*n-w*s-_*a,t}function wm(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,_=d*c+g*a+f*s-h*n,A=g*c-f*n-h*s-d*a;return Vc(t,e,r),n=t[0],s=t[1],a=t[2],c=t[3],t[4]=x*c+A*n+w*a-_*s,t[5]=w*c+A*s+_*n-x*a,t[6]=_*c+A*a+x*s-w*n,t[7]=A*c-x*n-w*s-_*a,t}function Mm(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,_=d*c+g*a+f*s-h*n,A=g*c-f*n-h*s-d*a;return zc(t,e,r),n=t[0],s=t[1],a=t[2],c=t[3],t[4]=x*c+A*n+w*a-_*s,t[5]=w*c+A*s+_*n-x*a,t[6]=_*c+A*a+x*s-w*n,t[7]=A*c-x*n-w*s-_*a,t}function _m(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 Rm(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 bm(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 Pm(t){return"quat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+")"}function km(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 Um(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],_=e[3],A=e[4],N=e[5],m=e[6],S=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-_)<=Q*Math.max(1,Math.abs(a),Math.abs(_))&&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-S)<=Q*Math.max(1,Math.abs(d),Math.abs(S))}var Lm=Object.freeze({__proto__:null,add:Am,clone:om,conjugate:Om,copy:Yc,create:am,dot:Jc,equals:Um,exactEquals:km,fromMat4:hm,fromRotation:um,fromRotationTranslation:Xc,fromRotationTranslationValues:lm,fromTranslation:fm,fromValues:cm,getDual:mm,getReal:gm,getTranslation:xm,identity:dm,invert:Nm,len:Fm,length:Zc,lerp:Cm,mul:Im,multiply:Kc,normalize:$m,rotateAroundAxis:bm,rotateByQuatAppend:_m,rotateByQuatPrepend:Rm,rotateX:Em,rotateY:wm,rotateZ:Mm,scale:Sm,set:pm,setDual:ym,setReal:vm,sqrLen:Dm,squaredLength:Vn,str:Pm,translate:Tm});function Qc(){var t=new le(2);return le!=Float32Array&&(t[0]=0,t[1]=0),t}function jm(t){var e=new le(2);return e[0]=t[0],e[1]=t[1],e}function Bm(t,e){var r=new le(2);return r[0]=t,r[1]=e,r}function Vm(t,e){return t[0]=e[0],t[1]=e[1],t}function zm(t,e,r){return t[0]=e,t[1]=r,t}function Gm(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t}function el(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t}function tl(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t}function rl(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t}function Hm(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t}function qm(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t}function Wm(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t}function Xm(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t}function Ym(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t}function Km(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t}function Jm(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t}function nl(t,e){var r=e[0]-t[0],n=e[1]-t[1];return Math.hypot(r,n)}function sl(t,e){var r=e[0]-t[0],n=e[1]-t[1];return r*r+n*n}function il(t){var e=t[0],r=t[1];return Math.hypot(e,r)}function al(t){var e=t[0],r=t[1];return e*e+r*r}function Zm(t,e){return t[0]=-e[0],t[1]=-e[1],t}function Qm(t,e){return t[0]=1/e[0],t[1]=1/e[1],t}function ev(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 tv(t,e){return t[0]*e[0]+t[1]*e[1]}function rv(t,e,r){var n=e[0]*r[1]-e[1]*r[0];return t[0]=t[1]=0,t[2]=n,t}function nv(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 sv(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 iv(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 av(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 ov(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 cv(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 lv(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 fv(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 uv(t){return t[0]=0,t[1]=0,t}function hv(t){return"vec2("+t[0]+", "+t[1]+")"}function dv(t,e){return t[0]===e[0]&&t[1]===e[1]}function pv(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 gv=il,mv=el,vv=tl,yv=rl,xv=nl,Tv=sl,Ev=al,wv=function(){var t=Qc();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(C,I,$=j=>j){if(I)for(let j of I)C.push_back($(j));return C}function o(C,I=$=>$){const $=[],j=C.size();for(let J=0;J$){const $=[],j=C.size();for(let J=0;Ji(new r.Vector_vec2,I,$=>$ instanceof Array?{x:$[0],y:$[1]}:$))}function p(C){for(let I=0;IC.min[I]),max:["x","y"].map(I=>C.max[I])}},r.CrossSection.prototype.offset=function(C,I="Square",$=2,j=0){return this._Offset(C,F(I),$,j)},r.CrossSection.prototype.extrude=function(C,I=0,$=0,j=[1,1],J=!1){j=v([j]);const pe=r._Extrude(this,C,I,$,j);return J?pe.translate([0,0,-C/2]):pe},r.CrossSection.prototype.revolve=function(C=0,I=360){return r._Revolve(this,C,I)},r.CrossSection.prototype.add=function(C){return this._add(z(C))},r.CrossSection.prototype.subtract=function(C){return this._subtract(z(C))},r.CrossSection.prototype.intersect=function(C){return this._intersect(z(C))},r.CrossSection.prototype.toPolygons=function(){const C=this._ToPolygons(),I=l(C);return C.delete(),I},r.Manifold.prototype.warp=function(C){const I=Ir(function(J){const pe=ct(J,"float"),ue=ct(J+4,"float"),st=ct(J+8,"float"),qe=[pe,ue,st];C(qe),ar(J,qe[0],"float"),ar(J+4,qe[1],"float"),ar(J+8,qe[2],"float")},"vi"),$=this._Warp(I);Sr(I);const j=$.status();if(j.value!==0)throw new r.ManifoldError(j.value);return $},r.Manifold.prototype.setProperties=function(C,I){const $=this.numProp(),j=Ir(function(pe,ue,st){const qe=[];for(let ke=0;keC.min[I]),max:["x","y","z"].map(I=>C.max[I])}};class Y{constructor({numProp:I=3,triVerts:$=new Uint32Array,vertProperties:j=new Float32Array,mergeFromVert:J,mergeToVert:pe,runIndex:ue,runOriginalID:st,faceID:qe,halfedgeTangent:fr,runTransform:ur}={}){this.numProp=I,this.triVerts=$,this.vertProperties=j,this.mergeFromVert=J,this.mergeToVert=pe,this.runIndex=ue,this.runOriginalID=st,this.faceID=qe,this.halfedgeTangent=fr,this.runTransform=ur}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(C=[0,0,0]){return C instanceof Array&&(C={0:C[0],1:C[1],2:C[2]}),new Y(this._GetMeshJS(C))},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(C,I="Positive"){const $=u(C),j=new D($,M(I));return p($),j},r.CrossSection.ofPolygons=function(C,I="Positive"){return new r.CrossSection(C,I)},r.CrossSection.square=function(...C){let I;C.length==0?I={x:1,y:1}:typeof C[0]=="number"?I={x:C[0],y:C[0]}:I=v(C);const $=C[1]||!1;return r._Square(I,$)},r.CrossSection.circle=function(C,I=0){return r._Circle(C,I)};function q(C){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"+C]($);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(C,I){i(C,I,$=>$ instanceof Array?{x:$[0],y:$[1]}:$)}r.CrossSection.hull=function(...C){C.length==1&&(C=C[0]);let I=new r.Vector_vec2;for(const j of C)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:()=>C=>C instanceof D});const Z=r.Manifold;r.Manifold=function(C){const I=new Z(C),$=I.status();if($.value!==0)throw new r.ManifoldError($.value);return I},r.Manifold.ofMesh=function(C){return new r.Manifold(C)},r.Manifold.tetrahedron=function(){return r._Tetrahedron()},r.Manifold.cube=function(...C){let I;C.length==0?I={x:1,y:1,z:1}:typeof C[0]=="number"?I={x:C[0],y:C[0],z:C[0]}:I=E(C);const $=C[1]||!1;return r._Cube(I,$)},r.Manifold.cylinder=function(C,I,$=-1,j=0,J=!1){return r._Cylinder(C,I,$,j,J)},r.Manifold.sphere=function(C,I=0){return r._Sphere(C,I)},r.Manifold.smooth=function(C,I=[]){const $=new r.Vector_smoothness;i($,I);const j=r._Smooth(C,$);return $.delete(),j},r.Manifold.extrude=function(C,I,$=0,j=0,J=[1,1],pe=!1){return(C instanceof D?C:r.CrossSection(C,"Positive")).extrude(I,$,j,J,pe)},r.Manifold.revolve=function(C,I=0,$=360){return(C instanceof D?C:r.CrossSection(C,"Positive")).revolve(I,$)},r.Manifold.reserveIDs=function(C){return r._ReserveIDs(C)},r.Manifold.compose=function(C){const I=new r.Vector_manifold;i(I,C);const $=r._manifoldCompose(I);return I.delete(),$};function he(C){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"+C+"N"]($);return $.delete(),j}}r.Manifold.union=he("Union"),r.Manifold.difference=he("Difference"),r.Manifold.intersection=he("Intersection"),r.Manifold.levelSet=function(C,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=Ir(function(st){const qe=ct(st,"float"),fr=ct(st+4,"float"),ur=ct(st+8,"float");return C([qe,fr,ur])},"fi"),ue=r._LevelSet(pe,J,$,j);return Sr(pe),ue};function me(C,I){i(C,I,$=>$ instanceof Array?{x:$[0],y:$[1],z:$[2]}:$)}r.Manifold.hull=function(...C){C.length==1&&(C=C[0]);let I=new r.Vector_vec3;for(const j of C)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:()=>C=>C instanceof Z}),r.triangulate=function(C,I=-1){const $=u(C),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 _,A,N;if(g){const{createRequire:i}=await import("./__vite-browser-external-4ed993c7.js");var m=i(import.meta.url),S=m("fs"),T=m("path");d?x=T.dirname(x)+"/":x=m("url").fileURLToPath(new URL("./",self.location)),_=(o,l)=>(o=ir(o)?new URL(o):T.normalize(o),S.readFileSync(o,l?void 0:"utf8")),N=o=>{var l=_(o,!0);return l.buffer||(l=new Uint8Array(l)),l},A=(o,l,u,p=!0)=>{o=ir(o)?new URL(o):T.normalize(o),S.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="",_=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"&&Ve("no native wasm support detected");var P,V=!1;function B(i,o){i||Ve(o)}var k,G,H,K,L,U,ee,fe;function ie(){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());Gn(ve)}function Ue(){!r.noFSInit&&!y.init.initialized&&y.init(),y.ignorePermissions=!1,Gn(xe)}function Ae(){if(r.postRun)for(typeof r.postRun=="function"&&(r.postRun=[r.postRun]);r.postRun.length;)ot(r.postRun.shift());Gn(Te)}function Ce(i){ve.unshift(i)}function et(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 Ve(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 Zr(i){return i.startsWith(Ft)}function ir(i){return i.startsWith("file://")}var Tt;r.locateFile?(Tt="manifold.wasm",Zr(Tt)||(Tt=w(Tt))):Tt=new URL("/assets/manifold-55ae2298.wasm",self.location).href;function vi(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 vl(i){if(!O&&(h||d)){if(typeof fetch=="function"&&!ir(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(()=>vi(i));if(A)return new Promise((o,l)=>{A(i,u=>o(new Uint8Array(u)),l)})}return Promise.resolve().then(()=>vi(i))}function yi(i,o,l){return vl(i).then(u=>WebAssembly.instantiate(u,o)).then(u=>u).then(l,u=>{b(`failed to asynchronously prepare wasm: ${u}`),Ve(u)})}function yl(i,o,l,u){return!i&&typeof WebAssembly.instantiateStreaming=="function"&&!Zr(o)&&!ir(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"),yi(o,l,u)})}):yi(o,l,u)}function xl(){var i={a:Du};function o(u,p){var v=u.exports;return _e=v,P=_e.Ua,ie(),ge=_e.Wa,et(_e.Va),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 yl(O,Tt,i,l).catch(s),{}}var de,je,Gn=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":Ve("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:Ve(`invalid type for getValue: ${o}`)}}function ar(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":Ve("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:Ve(`invalid type for setValue: ${l}`)}}var Qr=[],en=0,Tl=i=>{var o=new Hn(i);return o.get_caught()||(o.set_caught(!0),en--),o.set_rethrown(!1),Qr.push(o),Hi(o.excPtr),o.get_exception_ptr()},Et=0,El=()=>{re(0,0);var i=Qr.pop();Gi(i.excPtr),Et=0};function Hn(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=Wi(this.get_type());if(o)return U[this.excPtr>>2];var l=this.get_adjusted_ptr();return l!==0?l:this.excPtr}}var wl=i=>{throw Et||(Et=i),Et},xi=i=>{var o=Et;if(!o)return Cr(0),0;var l=new Hn(o);l.set_adjusted_ptr(o);var u=l.get_type();if(!u)return Cr(0),o;for(var p in i){var v=i[p];if(v===0||v===u)break;var E=l.ptr+16;if(qi(v,u,E))return Cr(v),o}return Cr(u),o},Ml=()=>xi([]),_l=i=>xi([i]),Rl=()=>{var i=Qr.pop();i||Ve("no exception to throw");var o=i.excPtr;throw i.get_rethrown()||(Qr.push(i),i.set_rethrown(!0),i.set_caught(!1),en++),Et=o,Et},bl=(i,o,l)=>{var u=new Hn(i);throw u.init(o,l),Et=i,en++,Et},Al=()=>en,tn={},qn=i=>{for(;i.length;){var o=i.pop(),l=i.pop();l(o)}};function Wn(i){return this.fromWireType(L[i>>2])}var or={},Dt={},rn={},Ti=void 0,nn=i=>{throw new Ti(i)},$t=(i,o,l)=>{i.forEach(function(M){rn[M]=o});function u(M){var F=l(M);F.length!==i.length&&nn("Mismatched type converter count");for(var D=0;D{Dt.hasOwnProperty(M)?p[F]=Dt[M]:(v.push(M),or.hasOwnProperty(M)||(or[M]=[]),or[M].push(()=>{p[F]=Dt[M],++E,E===v.length&&u(p)}))}),v.length===0&&u(p)},Il=i=>{var o=tn[i];delete tn[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 M={};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;M[z]={read:C=>Y.fromWireType(q(W,C)),write:(C,I)=>{var $=[];he(me,C,Z.toWireType($,I)),qn($)}}}),[{name:o.name,fromWireType:F=>{var D={};for(var z in M)D[z]=M[z].read(F);return u(F),D},toWireType:(F,D)=>{for(var z in M)if(!(z in D))throw new TypeError(`Missing field: "${z}"`);var Y=l();for(z in M)M[z].write(Y,D[z]);return F!==null&&F.push(u,Y),Y},argPackAdvance:pt,readValueFromPointer:Wn,destructorFunction:u}]})},Sl=(i,o,l,u,p)=>{},Cl=()=>{for(var i=new Array(256),o=0;o<256;++o)i[o]=String.fromCharCode(o);Ei=i},Ei=void 0,Be=i=>{for(var o="",l=i;G[l];)o+=Ei[G[l++]];return o},cr=void 0,ye=i=>{throw new cr(i)};function Nl(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 rn[i],or.hasOwnProperty(i)){var p=or[i];delete or[i],p.forEach(v=>v())}}function dt(i,o,l={}){if(!("argPackAdvance"in o))throw new TypeError("registerType registeredInstance requires argPackAdvance");return Nl(i,o,l)}var pt=8,Ol=(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 Fl(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 Dl=i=>({count:i.count,deleteScheduled:i.deleteScheduled,preservePointerOnDelete:i.preservePointerOnDelete,ptr:i.ptr,ptrType:i.ptrType,smartPtr:i.smartPtr,smartPtrType:i.smartPtrType}),Xn=i=>{function o(l){return l.$$.ptrType.registeredClass.name}ye(o(i)+" instance already deleted")},Yn=!1,wi=i=>{},$l=i=>{i.smartPtr?i.smartPtrType.rawDestructor(i.smartPtr):i.ptrType.registeredClass.rawDestructor(i.ptr)},Mi=i=>{i.count.value-=1;var o=i.count.value===0;o&&$l(i)},_i=(i,o,l)=>{if(o===l)return i;if(l.baseClass===void 0)return null;var u=_i(i,o,l.baseClass);return u===null?null:l.downcast(u)},Ri={},Pl=()=>Object.keys(_r).length,kl=()=>{var i=[];for(var o in _r)_r.hasOwnProperty(o)&&i.push(_r[o]);return i},wr=[],Kn=()=>{for(;wr.length;){var i=wr.pop();i.$$.deleteScheduled=!1,i.delete()}},Mr=void 0,Ul=i=>{Mr=i,wr.length&&Mr&&Mr(Kn)},Ll=()=>{r.getInheritedInstanceCount=Pl,r.getLiveInheritedInstances=kl,r.flushPendingDeletes=Kn,r.setDelayFunction=Ul},_r={},jl=(i,o)=>{for(o===void 0&&ye("ptr should not be undefined");i.baseClass;)o=i.upcast(o),i=i.baseClass;return o},Bl=(i,o)=>(o=jl(i,o),_r[o]),sn=(i,o)=>{(!o.ptrType||!o.ptr)&&nn("makeClassHandle requires ptr and ptrType");var l=!!o.smartPtrType,u=!!o.smartPtr;return l!==u&&nn("Both smartPtrType and smartPtr must be specified"),o.count={value:1},Rr(Object.create(i,{$$:{value:o}}))};function Vl(i){var o=this.getPointee(i);if(!o)return this.destructor(i),null;var l=Bl(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?sn(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:o,smartPtrType:this,smartPtr:i}):sn(this.registeredClass.instancePrototype,{ptrType:this,ptr:i})}var v=this.registeredClass.getActualType(o),E=Ri[v];if(!E)return p.call(this);var M;this.isConst?M=E.constPointerType:M=E.pointerType;var F=_i(o,this.registeredClass,M.registeredClass);return F===null?p.call(this):this.isSmartPointer?sn(M.registeredClass.instancePrototype,{ptrType:M,ptr:F,smartPtrType:this,smartPtr:i}):sn(M.registeredClass.instancePrototype,{ptrType:M,ptr:F})}var Rr=i=>typeof FinalizationRegistry>"u"?(Rr=o=>o,i):(Yn=new FinalizationRegistry(o=>{Mi(o.$$)}),Rr=o=>{var l=o.$$,u=!!l.smartPtr;if(u){var p={$$:l};Yn.register(o,p,o)}return o},wi=o=>Yn.unregister(o),Rr(i));function zl(){if(this.$$.ptr||Xn(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var i=Rr(Object.create(Object.getPrototypeOf(this),{$$:{value:Dl(this.$$)}}));return i.$$.count.value+=1,i.$$.deleteScheduled=!1,i}function Gl(){this.$$.ptr||Xn(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&ye("Object already scheduled for deletion"),wi(this),Mi(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)}function Hl(){return!this.$$.ptr}function ql(){return this.$$.ptr||Xn(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&ye("Object already scheduled for deletion"),wr.push(this),wr.length===1&&Mr&&Mr(Kn),this.$$.deleteScheduled=!0,this}var Wl=()=>{St.prototype.isAliasOf=Fl,St.prototype.clone=zl,St.prototype.delete=Gl,St.prototype.isDeleted=Hl,St.prototype.deleteLater=ql};function St(){}var Xl=48,Yl=57,an=i=>{if(i===void 0)return"_unknown";i=i.replace(/[^a-zA-Z0-9_]/g,"$");var o=i.charCodeAt(0);return o>=Xl&&o<=Yl?`_${i}`:i};function on(i,o){return i=an(i),{[i]:function(){return o.apply(this,arguments)}}[i]}var bi=(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}},Jn=(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`),bi(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 Kl(i,o,l,u,p,v,E,M){this.name=i,this.constructor=o,this.instancePrototype=l,this.rawDestructor=u,this.baseClass=p,this.getActualType=v,this.upcast=E,this.downcast=M,this.pureVirtualFunctions=[]}var Zn=(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 Jl(i,o){if(o===null)return this.isReference&&ye(`null is not a valid ${this.name}`),0;o.$$||ye(`Cannot pass "${rs(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=Zn(o.$$.ptr,l,this.registeredClass);return u}function Zl(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 "${rs(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=Zn(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 Ql(i,o){if(o===null)return this.isReference&&ye(`null is not a valid ${this.name}`),0;o.$$||ye(`Cannot pass "${rs(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=Zn(o.$$.ptr,l,this.registeredClass);return u}function Ai(i){return this.fromWireType(U[i>>2])}function ef(i){return this.rawGetPointee&&(i=this.rawGetPointee(i)),i}function tf(i){this.rawDestructor&&this.rawDestructor(i)}var rf=i=>{i!==null&&i.delete()},nf=()=>{wt.prototype.getPointee=ef,wt.prototype.destructor=tf,wt.prototype.argPackAdvance=pt,wt.prototype.readValueFromPointer=Ai,wt.prototype.deleteObject=rf,wt.prototype.fromWireType=Vl};function wt(i,o,l,u,p,v,E,M,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=M,this.rawConstructor=F,this.rawShare=D,this.rawDestructor=z,!p&&o.baseClass===void 0?u?(this.toWireType=Jl,this.destructorFunction=null):(this.toWireType=Ql,this.destructorFunction=null):this.toWireType=Zl}var Ii=(i,o,l)=>{r.hasOwnProperty(i)||nn("Replacing nonexistant public symbol"),r[i].overloadTable!==void 0&&l!==void 0?r[i].overloadTable[l]=o:(r[i]=o,r[i].argCount=l)},sf=(i,o,l)=>{var u=r["dynCall_"+i];return l&&l.length?u.apply(null,[o].concat(l)):u.call(null,o)},br=[],ae=i=>{var o=br[i];return o||(i>=br.length&&(br.length=i+1),br[i]=o=ge.get(i)),o},af=(i,o,l)=>{if(i.includes("j"))return sf(i,o,l);var u=ae(o).apply(null,l);return u},of=(i,o)=>{var l=[];return function(){return l.length=0,Object.assign(l,arguments),af(i,o,l)}},lt=(i,o)=>{i=Be(i);function l(){return i.includes("j")?of(i,o):ae(o)}var u=l();return typeof u!="function"&&ye(`unknown function pointer with signature ${i}: ${o}`),u},cf=(i,o)=>{var l=on(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},Si=void 0,Ci=i=>{var o=zi(i),l=Be(o);return _t(o),l},cn=(i,o)=>{var l=[],u={};function p(v){if(!u[v]&&!Dt[v]){if(rn[v]){rn[v].forEach(p);return}l.push(v),u[v]=!0}}throw o.forEach(p),new Si(`${i}: `+l.map(Ci).join([", "]))},lf=(i,o,l,u,p,v,E,M,F,D,z,Y,q)=>{z=Be(z),v=lt(p,v),M&&(M=lt(E,M)),D&&(D=lt(F,D)),q=lt(Y,q);var W=an(z);Jn(W,function(){cn(`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 C=on(W,function(){if(Object.getPrototypeOf(this)!==I)throw new cr("Use 'new' to construct "+z);if($.constructor_body===void 0)throw new cr(z+" has no accessible constructor");var ue=$.constructor_body[arguments.length];if(ue===void 0)throw new cr(`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:C}});C.prototype=I;var $=new Kl(z,C,I,q,he,v,M,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 Ri[i]={pointerType:J,constPointerType:pe},Ii(W,C),[j,J,pe]})},Qn=(i,o)=>{for(var l=[],u=0;u>2]);return l};function Ni(i,o){if(!(i instanceof Function))throw new TypeError(`new_ called with constructor type ${typeof i} which is not a function`);var l=on(i.name||"unknownFunctionName",function(){});l.prototype=i.prototype;var u=new l,p=i.apply(u,o);return p instanceof Object?p:u}function es(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 M=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=M?1:2;D{var E=Qn(o,l);p=lt(u,p),$t([],[i],function(M){M=M[0];var F=`constructor ${M.name}`;if(M.registeredClass.constructor_body===void 0&&(M.registeredClass.constructor_body=[]),M.registeredClass.constructor_body[o-1]!==void 0)throw new cr(`Cannot register multiple constructors with identical number of parameters (${o-1}) for class '${M.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return M.registeredClass.constructor_body[o-1]=()=>{cn(`Cannot construct ${M.name} due to unbound types`,E)},$t([],E,D=>(D.splice(1,0,null),M.registeredClass.constructor_body[o-1]=es(F,D,null,p,v),[])),[]})},uf=(i,o,l,u,p,v,E,M,F)=>{var D=Qn(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)]),M&&z.registeredClass.pureVirtualFunctions.push(o);function q(){cn(`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):(bi(W,o,Y),W[o].overloadTable[l-2]=q),$t([],D,function(he){var me=es(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 hf(){Object.assign(Oi.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 Oi(){this.allocated=[void 0],this.freelist=[]}var nt=new Oi,ts=i=>{i>=nt.reserved&&--nt.get(i).refcount===0&&nt.free(i)},df=()=>{for(var i=0,o=nt.reserved;o{nt.allocated.push({value:void 0},{value:null},{value:!0},{value:!1}),nt.reserved=nt.allocated.length,r.count_emval_handles=df},Pe={toValue:i=>(i||ye("Cannot use deleted val. handle = "+i),nt.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 nt.allocate({refcount:1,value:i})}}},gf=(i,o)=>{o=Be(o),dt(i,{name:o,fromWireType:l=>{var u=Pe.toValue(l);return ts(l),u},toWireType:(l,u)=>Pe.toHandle(u),argPackAdvance:pt,readValueFromPointer:Wn,destructorFunction:null})},mf=(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}`)}},vf=(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:mf(o,l,u),destructorFunction:null}),Jn(o,p)},ln=(i,o)=>{var l=Dt[i];return l===void 0&&ye(o+" has unknown type "+Ci(i)),l},yf=(i,o,l)=>{var u=ln(i,"enum");o=Be(o);var p=u.constructor,v=Object.create(u.constructor.prototype,{value:{value:l},constructor:{value:on(`${u.name}_${o}`,function(){})}});p.values[l]=v,p[o]=v},rs=i=>{if(i===null)return"null";var o=typeof i;return o==="object"||o==="array"||o==="function"?i.toString():""+i},xf=(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}`)}},Tf=(i,o,l)=>{o=Be(o),dt(i,{name:o,fromWireType:u=>u,toWireType:(u,p)=>p,argPackAdvance:pt,readValueFromPointer:xf(o,l),destructorFunction:null})},Ef=(i,o,l,u,p,v,E)=>{var M=Qn(o,l);i=Be(i),p=lt(u,p),Jn(i,function(){cn(`Cannot call ${i} due to unbound types`,M)},o-1),$t([],M,function(F){var D=[F[0],null].concat(F.slice(1));return Ii(i,es(i,D,null,p,v,E),o-1),[]})},wf=(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}`)}},Mf=(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 M=o.includes("unsigned"),F=(z,Y)=>{},D;M?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:wf(o,l,u!==0),destructorFunction:null})},_f=(i,o,l)=>{var u=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],p=u[o];function v(E){var M=U[E>>2],F=U[E+4>>2];return new p(k.buffer,F,M)}l=Be(l),dt(i,{name:l,fromWireType:v,argPackAdvance:pt,readValueFromPointer:v},{ignoreDuplicateRegistrations:!0})},ns=(i,o,l,u)=>{if(!(u>0))return 0;for(var p=l,v=l+u-1,E=0;E=55296&&M<=57343){var F=i.charCodeAt(++E);M=65536+((M&1023)<<10)|F&1023}if(M<=127){if(l>=v)break;o[l++]=M}else if(M<=2047){if(l+1>=v)break;o[l++]=192|M>>6,o[l++]=128|M&63}else if(M<=65535){if(l+2>=v)break;o[l++]=224|M>>12,o[l++]=128|M>>6&63,o[l++]=128|M&63}else{if(l+3>=v)break;o[l++]=240|M>>18,o[l++]=128|M>>12&63,o[l++]=128|M>>6&63,o[l++]=128|M&63}}return o[l]=0,l-p},Rf=(i,o,l)=>ns(i,G,o,l),ss=i=>{for(var o=0,l=0;l=55296&&u<=57343?(o+=4,++l):o+=3}return o},Fi=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,lr=(i,o,l)=>{for(var u=o+l,p=o;i[p]&&!(p>=u);)++p;if(p-o>16&&i.buffer&&Fi)return Fi.decode(i.subarray(o,p));for(var v="";o>10,56320|D&1023)}}return v},fn=(i,o)=>i?lr(G,i,o):"",bf=(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 M=v,F=0;F<=p;++F){var D=v+F;if(F==p||G[D]==0){var z=D-M,Y=fn(M,z);E===void 0?E=Y:(E+=String.fromCharCode(0),E+=Y),M=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=ss(p):v=p.length;var M=fs(4+v+1),F=M+4;if(U[M>>2]=v,l&&E)Rf(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)})},Di=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,Af=(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&&Di)return Di.decode(G.subarray(i,l));for(var v="",E=0;!(E>=o/2);++E){var M=H[i+E*2>>1];if(M==0)break;v+=String.fromCharCode(M)}return v},If=(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},Sf=i=>i.length*2,Cf=(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},Nf=(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 M=i.charCodeAt(++v);E=65536+((E&1023)<<10)|M&1023}if(L[o>>2]=E,o+=4,o+4>p)break}return L[o>>2]=0,o-u},Of=i=>{for(var o=0,l=0;l=55296&&u<=57343&&++l,o+=4}return o},Ff=(i,o,l)=>{l=Be(l);var u,p,v,E,M;o===2?(u=Af,p=If,E=Sf,v=()=>K,M=1):o===4&&(u=Cf,p=Nf,E=Of,v=()=>U,M=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>>M]==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=fs(4+z+o);return U[Y>>2]=z>>M,p(D,Y+4,z+o),F!==null&&F.push(_t,Y),Y},argPackAdvance:pt,readValueFromPointer:Wn,destructorFunction:F=>_t(F)})},Df=(i,o,l,u,p,v)=>{tn[i]={name:Be(o),rawConstructor:lt(l,u),rawDestructor:lt(p,v),fields:[]}},$f=(i,o,l,u,p,v,E,M,F,D)=>{tn[i].fields.push({fieldName:Be(o),getterReturnType:l,getter:lt(u,p),getterContext:v,setterArgumentType:E,setter:lt(M,F),setterContext:D})},Pf=(i,o)=>{o=Be(o),dt(i,{isVoid:!0,name:o,argPackAdvance:0,fromWireType:()=>{},toWireType:(l,u)=>{}})},kf=(i,o,l)=>{i=Pe.toValue(i),o=ln(o,"emval::as");var u=[],p=Pe.toHandle(u);return U[l>>2]=p,o.toWireType(u,i)},Uf=i=>{var o=[];return U[i>>2]=Pe.toHandle(o),o},Lf={},is=i=>{var o=Lf[i];return o===void 0?Be(i):o},un=[],jf=(i,o,l,u,p)=>(i=un[i],o=Pe.toValue(o),l=is(l),i(o,l,Uf(u),p)),Bf=(i,o,l,u)=>{i=un[i],o=Pe.toValue(o),l=is(l),i(o,l,null,u)},Vf=(i,o)=>(i=Pe.toValue(i),o=Pe.toValue(o),i==o),zf=i=>{var o=un.length;return un.push(i),o},Gf=(i,o)=>{for(var l=new Array(i),u=0;u>2],"parameter "+u);return l},$i=[],Hf=(i,o)=>{var l=Gf(i,o),u=l[0],p=u.name+"_$"+l.slice(1).map(function(Z){return Z.name}).join("_")+"$",v=$i[p];if(v!==void 0)return v;for(var E=["retType"],M=[u],F="",D=0;D(i=Pe.toValue(i),o=Pe.toValue(o),Pe.toHandle(i[o])),Wf=i=>{i>4&&(nt.get(i).refcount+=1)},Xf=i=>Pe.toHandle(is(i)),Yf=()=>Pe.toHandle({}),Kf=i=>{var o=Pe.toValue(i);qn(o),ts(i)},Jf=(i,o,l)=>{i=Pe.toValue(i),o=Pe.toValue(o),l=Pe.toValue(l),i[o]=l},Zf=(i,o)=>{i=ln(i,"_emval_take_value");var l=i.readValueFromPointer(o);return Pe.toHandle(l)},Qf=()=>{Ve("")},eu=(i,o,l)=>G.copyWithin(i,o,o+l),tu=()=>2147483648,ru=i=>{var o=P.buffer,l=(i-o.byteLength+65535)/65536;try{return P.grow(l),ie(),1}catch{}},nu=i=>{var o=G.length;i>>>=0;var l=tu();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)),M=ru(E);if(M)return!0}return!1},as={},su=()=>f||"./this.program",Ar=()=>{if(!Ar.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,_:su()};for(var l in as)as[l]===void 0?delete o[l]:o[l]=as[l];var u=[];for(var l in o)u.push(`${l}=${o[l]}`);Ar.strings=u}return Ar.strings},iu=(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)},au=()=>{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{}Ve("initRandomDevice")},Pi=i=>(Pi=au())(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,M=0;M0?l:ss(i)+1,p=new Array(u),v=ns(i,p,0,p.length);return o&&(p.length=v),p}var ou=()=>{if(!os.length){var i=null;if(g){var o=256,l=Buffer.alloc(o),u=0,p=process.stdin.fd;try{u=S.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;os=hn(i,!0)}return os.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(lr(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(lr(i.output,0)),i.output=[]):o!=0&&i.output.push(o)},fsync(i){i.output&&i.output.length>0&&(b(lr(i.output,0)),i.output=[])}}},ki=i=>{Ve()},ce={ops_table:null,mount(i){return ce.createNode(null,"/",16895,0)},createNode(i,o,l,u){if(y.isBlkdev(l)||y.isFIFO(l))throw new y.ErrnoError(63);ce.ops_table||(ce.ops_table={dir:{node:{getattr:ce.node_ops.getattr,setattr:ce.node_ops.setattr,lookup:ce.node_ops.lookup,mknod:ce.node_ops.mknod,rename:ce.node_ops.rename,unlink:ce.node_ops.unlink,rmdir:ce.node_ops.rmdir,readdir:ce.node_ops.readdir,symlink:ce.node_ops.symlink},stream:{llseek:ce.stream_ops.llseek}},file:{node:{getattr:ce.node_ops.getattr,setattr:ce.node_ops.setattr},stream:{llseek:ce.stream_ops.llseek,read:ce.stream_ops.read,write:ce.stream_ops.write,allocate:ce.stream_ops.allocate,mmap:ce.stream_ops.mmap,msync:ce.stream_ops.msync}},link:{node:{getattr:ce.node_ops.getattr,setattr:ce.node_ops.setattr,readlink:ce.node_ops.readlink},stream:{}},chrdev:{node:{getattr:ce.node_ops.getattr,setattr:ce.node_ops.setattr},stream:y.chrdev_stream_ops}});var p=y.createNode(i,o,l,u);return y.isDir(p.mode)?(p.node_ops=ce.ops_table.dir.node,p.stream_ops=ce.ops_table.dir.stream,p.contents={}):y.isFile(p.mode)?(p.node_ops=ce.ops_table.file.node,p.stream_ops=ce.ops_table.file.stream,p.usedBytes=0,p.contents=null):y.isLink(p.mode)?(p.node_ops=ce.ops_table.link.node,p.stream_ops=ce.ops_table.link.stream):y.isChrdev(p.mode)&&(p.node_ops=ce.ops_table.chrdev.node,p.stream_ops=ce.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&&ce.resizeFileStorage(i,o.size)},lookup(i,o){throw y.genericErrors[44]},mknod(i,o,l,u){return ce.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=ce.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 M=0;M0||l+o{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()},lu=r.preloadPlugins||[],fu=(i,o,l,u)=>{typeof Browser<"u"&&Browser.init();var p=!1;return lu.forEach(v=>{p||v.canHandle(o)&&(v.handle(i,o,l,u),p=!0)}),p},uu=(i,o,l,u,p,v,E,M,F,D)=>{var z=o?Mt.resolve(Ee.join2(i,o)):i;function Y(q){function W(Z){D&&D(),M||y.createDataFile(i,o,Z,u,p,F),v&&v(),xt()}fu(q,z,W,()=>{E&&E(),xt()})||W(q)}He(),typeof l=="string"?cu(l,q=>Y(q),E):Y(l)},hu=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},cs=(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 M={type:i,opts:o,mountpoint:l,mounts:[]},F=i.mount(M);return F.mount=M,M.root=F,u?y.root=F:v&&(v.mounted=M,v.mount&&v.mount.mounts.push(M)),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 M=y.nameTable[E];M;){var F=M.name_next;p.includes(M.mount)&&y.destroyNode(M),M=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,M,F;if(E=y.lookupPath(i,{parent:!0}),M=E.node,E=y.lookupPath(o,{parent:!0}),F=E.node,!M||!F)throw new y.ErrnoError(44);if(M.mount!==F.mount)throw new y.ErrnoError(75);var D=y.lookupNode(M,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(M,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(!M.node_ops.rename)throw new y.ErrnoError(63);if(y.isMountpoint(D)||Y&&y.isMountpoint(Y))throw new y.ErrnoError(10);if(F!==M&&(W=y.nodePermissions(M,"w"),W))throw new y.ErrnoError(W);y.hashRemoveNode(D);try{M.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"?hu(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 M=y.createStream({node:u,path:y.getPath(u),flags:o,seekable:!0,position:0,stream_ops:u.stream_ops,ungotten:[],error:!1});return M.stream_ops.open&&M.stream_ops.open(M),r.logReadFiles&&!(o&1)&&(y.readFiles||(y.readFiles={}),i in y.readFiles||(y.readFiles[i]=1)),M},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 M=i.stream_ops.write(i,o,l,u,p,v);return E||(i.position+=M),M},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=lr(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(ss(o)+1),v=ns(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,M)=>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=Pi(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(ce,{},"/"),y.createDefaultDirectories(),y.createDefaultDevices(),y.createSpecialDirectories(),y.filesystems={MEMFS:ce}},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",C=(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||[]):hn(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]}),(C||!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 M={isDevice:!1,contents:E}}else var M={isDevice:!1,url:l};var F=y.createFile(i,o,M,u,p);M.contents?F.contents=M.contents:M.url&&(F.contents=null,F.url=M.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 C=q.node.contents;if(me>=C.length)return 0;var I=Math.min(C.length-me,he);if(C.slice)for(var $=0;$(y.forceLoadFile(F),Y(q,W,Z,he,me)),D.mmap=(q,W,Z,he,me)=>{y.forceLoadFile(F);var C=ki();if(!C)throw new y.ErrnoError(48);return Y(q,k,C,W,Z),{ptr:C,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(M){if(M&&M.node&&Ee.normalize(o)!==Ee.normalize(y.getPath(M.node)))return-54;throw M}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=fn(i);return o},getStreamFromFD(i){var o=y.getStreamChecked(i);return o}},du=(i,o)=>{var l=0;return Ar().forEach((u,p)=>{var v=o+l;U[i+p*4>>2]=v,iu(u,v),l+=u.length+1}),0},pu=(i,o)=>{var l=Ar();U[i>>2]=l.length;var u=0;return l.forEach(p=>u+=p.length+1),U[o>>2]=u,0};function gu(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 mu=(i,o,l,u)=>{for(var p=0,v=0;v>2],M=U[o+4>>2];o+=8;var F=y.read(i,k,E,M,u);if(F<0)return-1;if(p+=F,F>2]=v,0}catch(E){if(typeof y>"u"||E.name!=="ErrnoError")throw E;return E.errno}}var yu=(i,o)=>o+2097152>>>0<4194305-!!i?(i>>>0)+o*4294967296:NaN;function xu(i,o,l,u,p){var v=yu(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(M){if(typeof y>"u"||M.name!=="ErrnoError")throw M;return M.errno}}var Tu=(i,o,l,u)=>{for(var p=0,v=0;v>2],M=U[o+4>>2];o+=8;var F=y.write(i,k,E,M,u);if(F<0)return-1;p+=F,typeof u<"u"&&(u+=F)}return p};function Eu(i,o,l,u){try{var p=Ct.getStreamFromFD(i),v=Tu(p,o,l);return U[u>>2]=v,0}catch(E){if(typeof y>"u"||E.name!=="ErrnoError")throw E;return E.errno}}var wu=i=>i,dn=i=>i%4===0&&(i%100!==0||i%400===0),Mu=(i,o)=>{for(var l=0,u=0;u<=o;l+=i[u++]);return l},Ui=[31,29,31,30,31,30,31,31,30,31,30,31],Li=[31,28,31,30,31,30,31,31,30,31,30,31],_u=(i,o)=>{for(var l=new Date(i.getTime());o>0;){var u=dn(l.getFullYear()),p=l.getMonth(),v=(u?Ui:Li)[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},Ru=(i,o)=>{k.set(i,o)},bu=(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?fn(p):""},E=fn(l),M={"%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 M)E=E.replace(new RegExp(F,"g"),M[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 $=_u(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+Mu(dn(I.tm_year+1900)?Ui:Li,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||!dn(I.tm_year))&&($=1)}}else{$=52;var j=(I.tm_wday+7-I.tm_yday-1)%7;(j==4||j==5&&dn(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 C=hn(E,!1);return C.length>o?0:(Ru(C,i),C.length-1)},Au=(i,o,l,u,p)=>bu(i,o,l,u),ji=(i,o)=>{i<128?o.push(i):o.push(i%128|128,i>>7)},Iu=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),ji(u.length,o);for(var v=0;v{if(typeof WebAssembly.Function=="function")return new WebAssembly.Function(Iu(o),i);var l=[1];Su(o,l);var u=[0,97,115,109,1,0,0,0,1];ji(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},Nu=(i,o)=>{if(kt)for(var l=i;l(kt||(kt=new WeakMap,Nu(0,ge.length)),kt.get(i)||0),ls=[],Fu=()=>{if(ls.length)return ls.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},Bi=(i,o)=>{ge.set(i,o),br[i]=ge.get(i)},Ir=(i,o)=>{var l=Ou(i);if(l)return l;var u=Fu();try{Bi(u,i)}catch(v){if(!(v instanceof TypeError))throw v;var p=Cu(i,o);Bi(u,p)}return kt.set(i,u),u},Sr=i=>{kt.delete(ae(i)),ls.push(i)};Ti=r.InternalError=class extends Error{constructor(o){super(o),this.name="InternalError"}},Cl(),cr=r.BindingError=class extends Error{constructor(o){super(o),this.name="BindingError"}},Wl(),Ll(),nf(),Si=r.UnboundTypeError=cf(Error,"UnboundTypeError"),hf(),pf();var Vi=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},pn=365,gn=146;Object.defineProperties(Vi.prototype,{read:{get:function(){return(this.mode&pn)===pn},set:function(i){i?this.mode|=pn:this.mode&=~pn}},write:{get:function(){return(this.mode&gn)===gn},set:function(i){i?this.mode|=gn:this.mode&=~gn}},isFolder:{get:function(){return y.isDir(this.mode)}},isDevice:{get:function(){return y.isChrdev(this.mode)}}}),y.FSNode=Vi,y.createPreloadedFile=uu,y.staticInit();var Du={C:Tl,M:El,a:Ml,k:_l,U:Rl,h:bl,qa:Al,d:wl,Ka:Il,da:Sl,va:Ol,y:lf,x:ff,j:uf,ta:gf,Q:vf,t:yf,W:Tf,o:Ef,A:Mf,s:_f,V:bf,O:Ff,F:Df,La:$f,wa:Pf,Qa:kf,Fa:jf,Na:Bf,Sa:ts,Pa:Vf,Ja:Hf,Ra:qf,Oa:Wf,H:Xf,aa:Yf,ua:Kf,Ta:Jf,z:Zf,N:Qf,sa:eu,ra:nu,ma:du,na:pu,oa:gu,pa:vu,ca:xu,T:Eu,za:gh,G:Yu,J:ju,B:ku,E:Ku,$:Wu,xa:vh,R:Th,Ca:hh,r:fh,c:Lu,b:Pu,n:Gu,l:zu,P:sh,D:yh,S:xh,L:Eh,ba:Ch,i:Xu,f:Uu,Ha:th,g:Bu,Da:uh,I:eh,_:Zu,Ia:Qu,u:rh,Ba:dh,Aa:ph,Ea:nh,e:$u,Ma:Hu,m:Vu,q:Ju,ya:mh,Z:ah,v:ih,w:ch,X:lh,p:qu,K:wh,Y:oh,fa:Ih,ia:Rh,ka:Mh,ja:_h,ga:Ah,ha:bh,ea:Sh,Ga:wu,la:Au},_e=xl(),fs=i=>(fs=_e.Xa)(i),_t=i=>(_t=_e.Ya)(i),zi=i=>(zi=_e.Za)(i);r.__embind_initialize_bindings=()=>(r.__embind_initialize_bindings=_e._a)();var re=(i,o)=>(re=_e.$a)(i,o),Cr=i=>(Cr=_e.ab)(i),ne=()=>(ne=_e.bb)(),se=i=>(se=_e.cb)(i),Gi=i=>(Gi=_e.db)(i),Hi=i=>(Hi=_e.eb)(i),qi=(i,o,l)=>(qi=_e.fb)(i,o,l),Wi=i=>(Wi=_e.gb)(i),Xi=r.dynCall_viiji=(i,o,l,u,p,v)=>(Xi=r.dynCall_viiji=_e.hb)(i,o,l,u,p,v),Yi=r.dynCall_viijii=(i,o,l,u,p,v,E)=>(Yi=r.dynCall_viijii=_e.ib)(i,o,l,u,p,v,E),Ki=r.dynCall_viiij=(i,o,l,u,p,v)=>(Ki=r.dynCall_viiij=_e.jb)(i,o,l,u,p,v),Ji=r.dynCall_vijiii=(i,o,l,u,p,v,E)=>(Ji=r.dynCall_vijiii=_e.kb)(i,o,l,u,p,v,E),Zi=r.dynCall_vijii=(i,o,l,u,p,v)=>(Zi=r.dynCall_vijii=_e.lb)(i,o,l,u,p,v),Qi=r.dynCall_viiiij=(i,o,l,u,p,v,E)=>(Qi=r.dynCall_viiiij=_e.mb)(i,o,l,u,p,v,E),ea=r.dynCall_vijij=(i,o,l,u,p,v,E)=>(ea=r.dynCall_vijij=_e.nb)(i,o,l,u,p,v,E);r.dynCall_jiji=(i,o,l,u,p)=>(r.dynCall_jiji=_e.ob)(i,o,l,u,p);var ta=r.dynCall_jiiii=(i,o,l,u,p)=>(ta=r.dynCall_jiiii=_e.pb)(i,o,l,u,p);r.dynCall_iiiiij=(i,o,l,u,p,v,E)=>(r.dynCall_iiiiij=_e.qb)(i,o,l,u,p,v,E),r.dynCall_iiiiijj=(i,o,l,u,p,v,E,M,F)=>(r.dynCall_iiiiijj=_e.rb)(i,o,l,u,p,v,E,M,F),r.dynCall_iiiiiijj=(i,o,l,u,p,v,E,M,F,D)=>(r.dynCall_iiiiiijj=_e.sb)(i,o,l,u,p,v,E,M,F,D);function $u(i,o,l,u){var p=ne();try{ae(i)(o,l,u)}catch(v){if(se(p),v!==v+0)throw v;re(1,0)}}function Pu(i,o,l){var u=ne();try{return ae(i)(o,l)}catch(p){if(se(u),p!==p+0)throw p;re(1,0)}}function ku(i,o,l,u,p,v){var E=ne();try{return ae(i)(o,l,u,p,v)}catch(M){if(se(E),M!==M+0)throw M;re(1,0)}}function Uu(i,o){var l=ne();try{ae(i)(o)}catch(u){if(se(l),u!==u+0)throw u;re(1,0)}}function Lu(i,o){var l=ne();try{return ae(i)(o)}catch(u){if(se(l),u!==u+0)throw u;re(1,0)}}function ju(i,o,l,u){var p=ne();try{return ae(i)(o,l,u)}catch(v){if(se(p),v!==v+0)throw v;re(1,0)}}function Bu(i,o,l){var u=ne();try{ae(i)(o,l)}catch(p){if(se(u),p!==p+0)throw p;re(1,0)}}function Vu(i,o,l,u,p){var v=ne();try{ae(i)(o,l,u,p)}catch(E){if(se(v),E!==E+0)throw E;re(1,0)}}function zu(i,o,l,u,p){var v=ne();try{return ae(i)(o,l,u,p)}catch(E){if(se(v),E!==E+0)throw E;re(1,0)}}function Gu(i,o,l,u){var p=ne();try{return ae(i)(o,l,u)}catch(v){if(se(p),v!==v+0)throw v;re(1,0)}}function Hu(i,o,l,u,p,v,E){var M=ne();try{ae(i)(o,l,u,p,v,E)}catch(F){if(se(M),F!==F+0)throw F;re(1,0)}}function qu(i,o,l,u,p,v,E,M,F,D,z){var Y=ne();try{ae(i)(o,l,u,p,v,E,M,F,D,z)}catch(q){if(se(Y),q!==q+0)throw q;re(1,0)}}function Wu(i,o,l){var u=ne();try{return ae(i)(o,l)}catch(p){if(se(u),p!==p+0)throw p;re(1,0)}}function Xu(i){var o=ne();try{ae(i)()}catch(l){if(se(o),l!==l+0)throw l;re(1,0)}}function Yu(i,o,l){var u=ne();try{return ae(i)(o,l)}catch(p){if(se(u),p!==p+0)throw p;re(1,0)}}function Ku(i,o){var l=ne();try{return ae(i)(o)}catch(u){if(se(l),u!==u+0)throw u;re(1,0)}}function Ju(i,o,l,u,p,v){var E=ne();try{ae(i)(o,l,u,p,v)}catch(M){if(se(E),M!==M+0)throw M;re(1,0)}}function Zu(i,o,l,u,p){var v=ne();try{ae(i)(o,l,u,p)}catch(E){if(se(v),E!==E+0)throw E;re(1,0)}}function Qu(i,o,l,u,p,v,E,M,F){var D=ne();try{ae(i)(o,l,u,p,v,E,M,F)}catch(z){if(se(D),z!==z+0)throw z;re(1,0)}}function eh(i,o,l,u,p,v){var E=ne();try{ae(i)(o,l,u,p,v)}catch(M){if(se(E),M!==M+0)throw M;re(1,0)}}function th(i,o,l,u){var p=ne();try{ae(i)(o,l,u)}catch(v){if(se(p),v!==v+0)throw v;re(1,0)}}function rh(i,o,l,u){var p=ne();try{ae(i)(o,l,u)}catch(v){if(se(p),v!==v+0)throw v;re(1,0)}}function nh(i,o,l,u,p,v,E){var M=ne();try{ae(i)(o,l,u,p,v,E)}catch(F){if(se(M),F!==F+0)throw F;re(1,0)}}function sh(i,o,l,u,p,v){var E=ne();try{return ae(i)(o,l,u,p,v)}catch(M){if(se(E),M!==M+0)throw M;re(1,0)}}function ih(i,o,l,u,p,v,E){var M=ne();try{ae(i)(o,l,u,p,v,E)}catch(F){if(se(M),F!==F+0)throw F;re(1,0)}}function ah(i,o,l,u,p,v,E){var M=ne();try{ae(i)(o,l,u,p,v,E)}catch(F){if(se(M),F!==F+0)throw F;re(1,0)}}function oh(i,o,l,u,p,v,E,M,F,D,z,Y,q,W,Z,he,me,C,I){var $=ne();try{ae(i)(o,l,u,p,v,E,M,F,D,z,Y,q,W,Z,he,me,C,I)}catch(j){if(se($),j!==j+0)throw j;re(1,0)}}function ch(i,o,l,u,p,v,E,M){var F=ne();try{ae(i)(o,l,u,p,v,E,M)}catch(D){if(se(F),D!==D+0)throw D;re(1,0)}}function lh(i,o,l,u,p,v,E,M,F,D){var z=ne();try{ae(i)(o,l,u,p,v,E,M,F,D)}catch(Y){if(se(z),Y!==Y+0)throw Y;re(1,0)}}function fh(i){var o=ne();try{return ae(i)()}catch(l){if(se(o),l!==l+0)throw l;re(1,0)}}function uh(i,o,l,u){var p=ne();try{ae(i)(o,l,u)}catch(v){if(se(p),v!==v+0)throw v;re(1,0)}}function hh(i,o,l,u,p){var v=ne();try{return ae(i)(o,l,u,p)}catch(E){if(se(v),E!==E+0)throw E;re(1,0)}}function dh(i,o,l,u,p){var v=ne();try{ae(i)(o,l,u,p)}catch(E){if(se(v),E!==E+0)throw E;re(1,0)}}function ph(i,o,l,u,p,v){var E=ne();try{ae(i)(o,l,u,p,v)}catch(M){if(se(E),M!==M+0)throw M;re(1,0)}}function gh(i){var o=ne();try{return ae(i)()}catch(l){if(se(o),l!==l+0)throw l;re(1,0)}}function mh(i,o,l,u,p,v,E){var M=ne();try{ae(i)(o,l,u,p,v,E)}catch(F){if(se(M),F!==F+0)throw F;re(1,0)}}function vh(i,o,l,u){var p=ne();try{return ae(i)(o,l,u)}catch(v){if(se(p),v!==v+0)throw v;re(1,0)}}function yh(i,o,l,u,p,v,E){var M=ne();try{return ae(i)(o,l,u,p,v,E)}catch(F){if(se(M),F!==F+0)throw F;re(1,0)}}function xh(i,o,l,u,p,v,E,M){var F=ne();try{return ae(i)(o,l,u,p,v,E,M)}catch(D){if(se(F),D!==D+0)throw D;re(1,0)}}function Th(i,o,l,u){var p=ne();try{return ae(i)(o,l,u)}catch(v){if(se(p),v!==v+0)throw v;re(1,0)}}function Eh(i,o,l,u,p,v,E,M,F,D,z,Y){var q=ne();try{return ae(i)(o,l,u,p,v,E,M,F,D,z,Y)}catch(W){if(se(q),W!==W+0)throw W;re(1,0)}}function wh(i,o,l,u,p,v,E,M,F,D,z,Y,q,W,Z,he){var me=ne();try{ae(i)(o,l,u,p,v,E,M,F,D,z,Y,q,W,Z,he)}catch(C){if(se(me),C!==C+0)throw C;re(1,0)}}function Mh(i,o,l,u,p,v){var E=ne();try{Xi(i,o,l,u,p,v)}catch(M){if(se(E),M!==M+0)throw M;re(1,0)}}function _h(i,o,l,u,p,v,E){var M=ne();try{Yi(i,o,l,u,p,v,E)}catch(F){if(se(M),F!==F+0)throw F;re(1,0)}}function Rh(i,o,l,u,p,v){var E=ne();try{Ki(i,o,l,u,p,v)}catch(M){if(se(E),M!==M+0)throw M;re(1,0)}}function bh(i,o,l,u,p,v,E){var M=ne();try{Ji(i,o,l,u,p,v,E)}catch(F){if(se(M),F!==F+0)throw F;re(1,0)}}function Ah(i,o,l,u,p,v){var E=ne();try{Zi(i,o,l,u,p,v)}catch(M){if(se(E),M!==M+0)throw M;re(1,0)}}function Ih(i,o,l,u,p,v,E){var M=ne();try{Qi(i,o,l,u,p,v,E)}catch(F){if(se(M),F!==F+0)throw F;re(1,0)}}function Sh(i,o,l,u,p,v,E){var M=ne();try{ea(i,o,l,u,p,v,E)}catch(F){if(se(M),F!==F+0)throw F;re(1,0)}}function Ch(i,o,l,u,p){var v=ne();try{return ta(i,o,l,u,p)}catch(E){if(se(v),E!==E+0)throw E;re(1,0)}}r.addFunction=Ir,r.removeFunction=Sr;var mn;Me=function i(){mn||ra(),mn||(Me=i)};function ra(){if(Je>0||(Re(),Je>0))return;function i(){mn||(mn=!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 ra(),e.ready}})();const vt="EXT_mesh_manifold",Na="MERGE";class pi extends $e{static EXTENSION_NAME=vt;init(){pi.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 cl extends Se{extensionName=vt;prewriteTypes=[X.ACCESSOR];static EXTENSION_NAME=vt;createManifoldPrimitive(){return new pi(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,Na),e.addAccessorToUsageGroup(c,Na))}),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],_=c.primitives[0],A={indices:e.accessorIndexMap.get(s.getIndices()),mode:_.mode,attributes:{POSITION:_.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=Dr[G].components,L=Dr[f[H]].components;if(K!=L)throw new Error("Attribute sizes do not correspond: "+G+" and "+f[H]);Dr[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 _=0;f.forEach((R,b)=>{const O=Dr[R];if(O==null)throw new Error(R+" is not a recognized attribute.");if(O.type==null){++_;return}const P=O.components;if(_+P>w)throw new Error("Too many attribute channels.");const V=new Float32Array(P*x);for(let k=0;kb&&Dr[G[b]].type!=null&&k.setAttribute(R,B)}_+=P});const A=s.createManifoldPrimitive();a.setExtension("EXT_mesh_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()],S=[],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&&(S.push(R),T.push(O))}}if(S.length>0){const R=t.createAccessor("merge from").setBuffer(n).setType(te.Type.SCALAR).setArray(new Uint32Array(S)),b=t.createAccessor("merge to").setBuffer(n).setType(te.Type.SCALAR).setArray(new Uint32Array(T));A.setMerge(R,b)}return a}const Qe=await _v();Qe.setup();Ko(Array);const ll=Rv(new ed);ll.registerExtensions(Lo);const bv=["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","calculateCurvature","calculateNormals","smoothByNormals","smoothOut","refine","refineToLength","setProperties","asOriginal","trimByPlane","split","splitByPlane","slice","project","hull"],Iv=["square","circle","union","difference","intersection","compose","ofPolygons","hull"],Sv=["add","subtract","intersect","rectClip","decompose","transform","translate","rotate","scale","mirror","simplify","offset","hull"],fl=["show","only","setMaterial"],Cv=["setMinCircularAngle","setMinCircularEdgeLength","setCircularSegments","getCircularSegments","Mesh","GLTFNode","Manifold","CrossSection","setMorphStart","setMorphEnd"],Fa=fl.concat(Cv),$n=new Array;function zn(t,e,r){const n=Qe[t],s=r?n:n.prototype;for(const a of e){const c=s[a];s[a]=function(...f){const h=c(...f);return $n.push(h),h}}}zn("Manifold",Av,!1);zn("Manifold",bv,!0);zn("CrossSection",Sv,!1);zn("CrossSection",Iv,!0);for(const t of fl){const e=Qe[t];Qe[t]=function(...r){const n=e(...r);return $n.push(n),n}}Qe.cleanup=function(){for(const t of $n)if(t instanceof Array)for(const e of t)e.delete();else t.delete();$n.length=0};let gi=!1;const Pn=new Map,mi=new Map,Nv=30,ul={roughness:.2,metallic:1,baseColorFactor:[1,1,0],alpha:1,unlit:!1,animationLength:1,animationMode:"loop"},Ov={baseColorFactor:[1,0,0],alpha:.25,roughness:1,metallic:0},Fv={baseColorFactor:[.5,.5,.5],alpha:.25,roughness:1,metallic:0},Zt=new Array,kn=new Map,bn=new Map,tr=new Map,nr=new Map;let Kr=1,mr,qr,vs,An,Un;function Dv(){gi=!1,Pn.clear(),mi.clear(),Zt.length=0,kn.clear(),bn.clear(),tr.clear(),nr.clear(),Kr=1}class $v{_parent;manifold;translation;rotation;scale;material;name;constructor(e){this._parent=e,Zt.push(this)}clone(e){const r={...this};return r._parent=e,Zt.push(r),r}get parent(){return this._parent}}Qe.GLTFNode=$v;const Kt={...ul};Qe.setMaterial=(t,e)=>{const r=t.asOriginal();return kn.set(r.originalID(),e),r};Qe.setMorphStart=(t,e)=>{const r=nr.get(t);r!=null?r.start=e:nr.set(t,{start:e})};Qe.setMorphEnd=(t,e)=>{const r=nr.get(t);r!=null?r.end=e:nr.set(t,{end:e})};function hl(t,e){let r=t.asOriginal();return e.set(r.originalID(),r.getMesh()),r}Qe.show=t=>hl(t,Pn);Qe.only=t=>(gi=!0,hl(t,mi));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 pr(...t){self.console&&self.console.log(...t)}self.onmessage=async t=>{const e=`const globalDefaults = {}; +`+t.data+` +return exportModels(globalDefaults, typeof result === "undefined" ? undefined : result); +`;try{await new Function("exportModels","glMatrix","module",...Fa,e)(zv,ol,Qe,...Fa.map(n=>Qe[n]))}catch(r){console.log(r.toString()),self.postMessage({objectURL:null})}finally{Qe.cleanup(),Dv()}};function dl(t){const{quat:e}=ol,r=Math.PI/180,n=e.create();return e.rotateZ(n,n,r*t[2]),e.rotateY(n,n,r*t[1]),e.rotateX(n,n,r*t[0]),n}function ys(t,e,r,n){const s=r[e];if(s==null)return null;if(typeof s!="function")return s;const a=qr.getCount(),c=e=="rotation"?4:3,f=new Float32Array(c*a);for(let x=0;x{if(s.end)for(let w=0;w3)for(let N=0;N{const n=r.clone();t.addChild(n)})}function Bv(t,e,r,n,s){ml(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=Lv(t,r),{manifold:a}=r;if(a!=null){Pv(t,s,a);const c=pl(r),f=n.get(a);if(f==null){gl(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;Bv(t,s,g,Ln(t,c),Ln(t,d)),f.set(c,s)}else ml(s,h)}}return tr.set(r,Kr),e.components.push({id:`${Kr++}`,name:r.name,children:a==null?[]:[{objectID:`${tr.get(a)}`}]}),s}async function zv(t,e){Object.assign(Kt,ul),Object.assign(Kt,t);const r=new js,n=Math.sqrt(2)/2,s=1/1e3,a=r.createNode("wrapper").setRotation([-n,0,0,n]).setScale([s,s,s]);r.createScene().addChild(a),mr=r.createAnimation(""),Un=!1;const c=Math.round(Kt.animationLength*Nv)+1,f=new Float32Array(c),h=new Float32Array(c);for(let S=0;S0){const S=new Map,T=new Map;let R=0;for(const b of Zt)S.set(b,Vv(r,d,b,T)),b.manifold&&++R;for(const b of Zt){const O=S.get(b),P={objectID:`${tr.get(b)}`,transform:O.getMatrix()},{parent:V}=b;V==null?(a.addChild(O),d.items.push(P)):(S.get(V).addChild(O),d.components.find(k=>k.id==`${tr.get(V)}`).children.push(P))}pr("Total glTF nodes: ",Zt.length,", Total mesh references: ",R)}else{if(e==null){pr('No output because "result" is undefined and no "GLTFNode"s were created.');return}const S=r.createNode();gl(r,d,S,e),a.addChild(S),d.items.push({objectID:`${tr.get(e)}`})}Un||(qr.dispose(),vs.dispose(),An.dispose(),mr.dispose());const g=await ll.writeBinary(r),x=new Blob([g],{type:"application/octet-stream"}),w=new Jd;w.add3dModel("3D/3dmodel.model");const _=Kd(d),A={};A["3D/3dmodel.model"]=Hr(_),A[_a.name]=Hr(_a.content),A[w.name]=Hr(w.content);const N=hp(A),m=new Blob([N],{type:"application/vnd.ms-package.3dmanufacturing-3dmodel+xml"});self.postMessage({glbURL:URL.createObjectURL(x),threeMFURL:URL.createObjectURL(m)})} 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..bd13fe295 --- /dev/null +++ b/docs/html/annotated.html @@ -0,0 +1,188 @@ + + + + + + + +Manifold: Class List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Class List
+
+ +
+ + + + diff --git a/docs/html/annotated_dup.js b/docs/html/annotated_dup.js new file mode 100644 index 000000000..75fbb78c7 --- /dev/null +++ b/docs/html/annotated_dup.js @@ -0,0 +1,74 @@ +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" ], + [ "SVDSet", "group___connections.html#structmanifold_1_1_s_v_d_set", null ], + [ "Timer", "structmanifold_1_1_timer.html", null ], + [ "TmpEdge", "structmanifold_1_1_tmp_edge.html", null ], + [ "TmpInvalid", "structmanifold_1_1_tmp_invalid.html", null ], + [ "topologyErr", "structmanifold_1_1topology_err.html", null ], + [ "TriRef", "structmanifold_1_1_tri_ref.html", "structmanifold_1_1_tri_ref" ], + [ "UnionFind", "structmanifold_1_1_union_find.html", null ], + [ "userErr", "structmanifold_1_1user_err.html", null ], + [ "Vec", "classmanifold_1_1_vec.html", null ], + [ "VecView", "classmanifold_1_1_vec_view.html", null ] + ] ], + [ "nb", null, [ + [ "detail", null, [ + [ "type_caster< glm::mat< C, R, T, Q > >", "structnb_1_1detail_1_1type__caster_3_01glm_1_1mat_3_01_c_00_01_r_00_01_t_00_01_q_01_4_01_4.html", null ], + [ "type_caster< glm::vec< N, T, Q > >", "structnb_1_1detail_1_1type__caster_3_01glm_1_1vec_3_01_n_00_01_t_00_01_q_01_4_01_4.html", null ], + [ "type_caster< manifold::VecView< glm::vec< N, T, Q > > >", "structnb_1_1detail_1_1type__caster_3_01manifold_1_1_vec_view_3_01glm_1_1vec_3_01_n_00_01_t_00_01_q_01_4_01_4_01_4.html", null ], + [ "type_caster< std::vector< glm::vec< N, T, Q > > >", "structnb_1_1detail_1_1type__caster_3_01std_1_1vector_3_01glm_1_1vec_3_01_n_00_01_t_00_01_q_01_4_01_4_01_4.html", null ] + ] ] + ] ], + [ "std", null, [ + [ "hash< glm::ivec3 >", "structstd_1_1hash_3_01glm_1_1ivec3_01_4.html", null ], + [ "hash< std::pair< int, int > >", "structstd_1_1hash_3_01std_1_1pair_3_01int_00_01int_01_4_01_4.html", null ] + ] ], + [ "CubeVoid", "struct_cube_void.html", null ], + [ "Edge", "struct_edge.html", null ], + [ "glm_name", "structglm__name.html", null ], + [ "glm_name< glm::ivec3 >", "structglm__name_3_01glm_1_1ivec3_01_4.html", null ], + [ "glm_name< glm::mat3x2 >", "structglm__name_3_01glm_1_1mat3x2_01_4.html", null ], + [ "glm_name< glm::mat4x3 >", "structglm__name_3_01glm_1_1mat4x3_01_4.html", null ], + [ "glm_name< glm::vec2 >", "structglm__name_3_01glm_1_1vec2_01_4.html", null ], + [ "glm_name< glm::vec3 >", "structglm__name_3_01glm_1_1vec3_01_4.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/boolean3_8h_source.html b/docs/html/boolean3_8h_source.html new file mode 100644 index 000000000..b2d1d63db --- /dev/null +++ b/docs/html/boolean3_8h_source.html @@ -0,0 +1,159 @@ + + + + + + + +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:45
+
OpType
Definition public.h:493
+
Definition meshIO.h:20
+
Definition impl.h:30
+
+
+ + + + diff --git a/docs/html/box_8cpp_source.html b/docs/html/box_8cpp_source.html new file mode 100644 index 000000000..ff19d9153 --- /dev/null +++ b/docs/html/box_8cpp_source.html @@ -0,0 +1,214 @@ + + + + + + + +Manifold: box.cpp Source File + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
box.cpp
+
+
+
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 "conv.h"
+
16#include "manifold.h"
+
17#include "public.h"
+
18#include "types.h"
+
19
+
20ManifoldBox *manifold_box(void *mem, float x1, float y1, float z1, float x2,
+
21 float y2, float z2) {
+
22 auto p1 = glm::vec3(x1, y1, z1);
+
23 auto p2 = glm::vec3(x2, y2, z2);
+
24 auto box = new (mem) Box(p1, p2);
+
25 return to_c(box);
+
26}
+
27
+
28ManifoldVec3 manifold_box_min(ManifoldBox *b) { return to_c((*from_c(b)).min); }
+
29
+
30ManifoldVec3 manifold_box_max(ManifoldBox *b) { return to_c((*from_c(b)).max); }
+
31
+
32ManifoldVec3 manifold_box_dimensions(ManifoldBox *b) {
+
33 auto v = from_c(b)->Size();
+
34 return {v.x, v.y, v.z};
+
35}
+
36
+
37ManifoldVec3 manifold_box_center(ManifoldBox *b) {
+
38 auto v = from_c(b)->Center();
+
39 return {v.x, v.y, v.z};
+
40}
+
41
+
42float manifold_box_scale(ManifoldBox *b) { return from_c(b)->Scale(); }
+
43
+
44int manifold_box_contains_pt(ManifoldBox *b, float x, float y, float z) {
+
45 auto p = glm::vec3(x, y, z);
+
46 return from_c(b)->Contains(p);
+
47}
+
48
+
49int manifold_box_contains_box(ManifoldBox *a, ManifoldBox *b) {
+
50 auto outer = *from_c(a);
+
51 auto inner = *from_c(b);
+
52 return outer.Contains(inner);
+
53}
+
54
+
55void manifold_box_include_pt(ManifoldBox *b, float x, float y, float z) {
+
56 auto box = *from_c(b);
+
57 auto p = glm::vec3(x, y, z);
+
58 box.Union(p);
+
59}
+
60
+
61ManifoldBox *manifold_box_union(void *mem, ManifoldBox *a, ManifoldBox *b) {
+
62 auto box = from_c(a)->Union(*from_c(b));
+
63 return to_c(new (mem) Box(box));
+
64}
+
65
+
66ManifoldBox *manifold_box_transform(void *mem, ManifoldBox *b, float x1,
+
67 float y1, float z1, float x2, float y2,
+
68 float z2, float x3, float y3, float z3,
+
69 float x4, float y4, float z4) {
+
70 auto mat = glm::mat4x3(x1, y1, z1, x2, y2, z2, x3, y3, z3, x4, y4, z4);
+
71 auto transformed = from_c(b)->Transform(mat);
+
72 return to_c(new (mem) Box(transformed));
+
73}
+
74
+
75ManifoldBox *manifold_box_translate(void *mem, ManifoldBox *b, float x, float y,
+
76 float z) {
+
77 auto p = glm::vec3(x, y, z);
+
78 auto translated = (*from_c(b)) + p;
+
79 return to_c(new (mem) Box(translated));
+
80}
+
81
+
82ManifoldBox *manifold_box_mul(void *mem, ManifoldBox *b, float x, float y,
+
83 float z) {
+
84 auto p = glm::vec3(x, y, z);
+
85 auto scaled = (*from_c(b)) * p;
+
86 return to_c(new (mem) Box(scaled));
+
87}
+
88
+
89int manifold_box_does_overlap_pt(ManifoldBox *b, float x, float y, float z) {
+
90 auto p = glm::vec3(x, y, z);
+
91 return from_c(b)->DoesOverlap(p);
+
92}
+
93
+
94int manifold_box_does_overlap_box(ManifoldBox *a, ManifoldBox *b) {
+
95 return from_c(a)->DoesOverlap(*from_c(b));
+
96}
+
97
+
98int manifold_box_is_finite(ManifoldBox *b) { return from_c(b)->IsFinite(); }
+
Manifold Transform(const glm::mat4x3 &) const
Definition manifold.cpp:537
+
Manifold Scale(glm::vec3) const
Definition manifold.cpp:509
+
Definition types.h:48
+
Definition public.h:171
+
+
+ + + + diff --git a/docs/html/classes.html b/docs/html/classes.html new file mode 100644 index 000000000..1d0022ea4 --- /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
+
+
+
B | C | E | F | G | H | I | L | M | O | P | Q | R | S | T | U | V
+
+
+
B
+
Barycentric (manifold)
Boolean3 (manifold)
Box (manifold)
+
+
C
+
Collider (manifold)
ConcurrentSharedPtr (manifold)
CrossSection (manifold)
CsgLeafNode (manifold)
CsgNode (manifold)
CsgOpNode (manifold)
CubeVoid
+
+
E
+
Edge
ExecutionParams (manifold)
ExportOptions (manifold)
+
+
F
+
SparseIndices::firstNonFinite (manifold)
+
+
G
+
geometryErr (manifold)
glm_name
glm_name< glm::ivec3 >
glm_name< glm::mat3x2 >
glm_name< glm::mat4x3 >
glm_name< glm::vec2 >
glm_name< glm::vec3 >
GyroidSDF
+
+
H
+
Halfedge (manifold)
Halfedge2Tmp (manifold)
hash< glm::ivec3 > (std)
hash< std::pair< int, int > > (std)
HashTable (manifold)
HashTableD (manifold)
+
+
I
+
Manifold::Impl (manifold)
+
+
L
+
Layers
+
+
M
+
Manifold (manifold)
ManifoldIVec3
ManifoldManifoldPair
ManifoldProperties
ManifoldVec2
ManifoldVec3
ManifoldVec4
Material (manifold)
Mesh (manifold)
MeshGL (manifold)
Manifold::Impl::MeshRelationD (manifold)
MeshSize
+
+
O
+
Options
+
+
P
+
PathImpl (manifold)
PolyVert (manifold)
Properties (manifold)
+
+
Q
+
Quality (manifold)
+
+
R
+
Rect (manifold)
ReindexEdge (manifold)
Manifold::Impl::Relation (manifold)
+
+
S
+
ConcurrentSharedPtr::SharedPtrGuard (manifold)
Smoothness (manifold)
SparseIndices (manifold)
strided_range::stride_functor (manifold)
strided_range (manifold)
SVDSet (manifold)
+
+
T
+
Timer (manifold)
TmpEdge (manifold)
TmpInvalid (manifold)
topologyErr (manifold)
TriRef (manifold)
type_caster< glm::mat< C, R, T, Q > > (nb::detail)
type_caster< glm::vec< N, T, Q > > (nb::detail)
type_caster< manifold::VecView< glm::vec< N, T, Q > > > (nb::detail)
type_caster< std::vector< glm::vec< N, T, Q > > > (nb::detail)
+
+
U
+
UnionFind (manifold)
userErr (manifold)
+
+
V
+
Vec (manifold)
VecView (manifold)
+
+
+
+ + + + diff --git a/docs/html/classmanifold_1_1_boolean3-members.html b/docs/html/classmanifold_1_1_boolean3-members.html new file mode 100644 index 000000000..e0740bc09 --- /dev/null +++ b/docs/html/classmanifold_1_1_boolean3-members.html @@ -0,0 +1,116 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Boolean3 Member List
+
+
+ +

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

+ + + +
Boolean3(const Manifold::Impl &inP, const Manifold::Impl &inQ, OpType op) (defined in Boolean3)Boolean3
Result(OpType op) const (defined in Boolean3)Boolean3
+
+ + + + diff --git a/docs/html/classmanifold_1_1_boolean3.html b/docs/html/classmanifold_1_1_boolean3.html new file mode 100644 index 000000000..615eeff30 --- /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..cf0793e5f --- /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..07fa49044 --- /dev/null +++ b/docs/html/classmanifold_1_1_collider.html @@ -0,0 +1,218 @@ + + + + + + + +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<const bool selfCollision, const bool inverted, typename T >
+ + + + + + + + +
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..ad6fda0ad --- /dev/null +++ b/docs/html/classmanifold_1_1_concurrent_shared_ptr-members.html @@ -0,0 +1,118 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
ConcurrentSharedPtr< T > Member List
+
+
+ +

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

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

+Classes

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

+Public Member Functions

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

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

+ + + + + +
operator*() (defined in ConcurrentSharedPtr< T >::SharedPtrGuard)ConcurrentSharedPtr< T >::SharedPtrGuardinline
operator->() (defined in ConcurrentSharedPtr< T >::SharedPtrGuard)ConcurrentSharedPtr< T >::SharedPtrGuardinline
SharedPtrGuard(std::recursive_mutex *mutex, T *content) (defined in ConcurrentSharedPtr< T >::SharedPtrGuard)ConcurrentSharedPtr< T >::SharedPtrGuardinline
~SharedPtrGuard() (defined in ConcurrentSharedPtr< T >::SharedPtrGuard)ConcurrentSharedPtr< T >::SharedPtrGuardinline
+
+ + + + diff --git a/docs/html/classmanifold_1_1_concurrent_shared_ptr_1_1_shared_ptr_guard.html b/docs/html/classmanifold_1_1_concurrent_shared_ptr_1_1_shared_ptr_guard.html new file mode 100644 index 000000000..41c3ce53a --- /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)
 
+Toperator* ()
 
+Toperator-> ()
 
+
+
+ + + + 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..89e7dbb54 --- /dev/null +++ b/docs/html/classmanifold_1_1_cross_section-members.html @@ -0,0 +1,156 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
CrossSection Member List
+
+
+ +

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

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Area() constCrossSection
BatchBoolean(const std::vector< CrossSection > &crossSections, OpType op)CrossSectionstatic
Boolean(const CrossSection &second, OpType op) constCrossSection
Bounds() constCrossSection
Circle(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
WarpBatch(std::function< void(VecView< 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..0388afb7c --- /dev/null +++ b/docs/html/classmanifold_1_1_cross_section.html @@ -0,0 +1,1215 @@ + + + + + + + +Manifold: CrossSection Class Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
CrossSection Class Reference
+
+
+ +

#include <cross_section.h>

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

Creation

Constructors

+
enum class  FillRule { EvenOdd +, NonZero +, Positive +, Negative + }
 
 CrossSection ()
 
 CrossSection (const CrossSection &other)
 
+CrossSectionoperator= (const CrossSection &other)
 
CrossSection (CrossSection &&) noexcept
 
+CrossSectionoperator= (CrossSection &&) noexcept
 
 CrossSection (const SimplePolygon &contour, FillRule fillrule=FillRule::Positive)
 
 CrossSection (const Polygons &contours, FillRule fillrule=FillRule::Positive)
 
 CrossSection (const Rect &rect)
 
static CrossSection Square (const 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 WarpBatch (std::function< void(VecView< 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.
+
+
+ +
+
+ +

◆ WarpBatch()

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

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

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

◆ Simplify()

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

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

+

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

+ +
+
+ +

◆ Offset()

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

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

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

◆ Boolean()

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

Perform the given boolean operation between this and another CrossSection.

+ +
+
+ +

◆ BatchBoolean()

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

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

+ +
+
+ +

◆ operator+()

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

Compute the boolean union between two cross-sections.

+ +
+
+ +

◆ operator+=()

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

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

+ +
+
+ +

◆ operator-()

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

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

+ +
+
+ +

◆ operator-=()

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

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

+ +
+
+ +

◆ operator^()

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

Compute the boolean intersection between two cross-sections.

+ +
+
+ +

◆ operator^=()

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

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

+ +
+
+ +

◆ Compose()

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

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

+ +
+
+ +

◆ Decompose()

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

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

+ +
+
+ +

◆ Hull() [1/4]

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

Compute the convex hull of this cross-section.

+ +
+
+ +

◆ Hull() [2/4]

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

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

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

◆ Hull() [3/4]

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

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

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

◆ Hull() [4/4]

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

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

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

◆ ToPolygons()

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

Return the contours of this CrossSection as a Polygons.

+ +
+
+
+
+ + + + diff --git a/docs/html/classmanifold_1_1_cross_section.js b/docs/html/classmanifold_1_1_cross_section.js new file mode 100644 index 000000000..1e407387c --- /dev/null +++ b/docs/html/classmanifold_1_1_cross_section.js @@ -0,0 +1,43 @@ +var classmanifold_1_1_cross_section = +[ + [ "FillRule", "classmanifold_1_1_cross_section.html#a9a534b0377c9ca41983d53b0dae0d5a4", [ + [ "EvenOdd", "classmanifold_1_1_cross_section.html#a9a534b0377c9ca41983d53b0dae0d5a4a8e586e4bd2c45e86222301f2e6e0e390", null ], + [ "NonZero", "classmanifold_1_1_cross_section.html#a9a534b0377c9ca41983d53b0dae0d5a4a3d0365a27a39c0af183445fc4d932a8a", null ], + [ "Positive", "classmanifold_1_1_cross_section.html#a9a534b0377c9ca41983d53b0dae0d5a4a3289297424e01eda5b788c083bbf3147", null ], + [ "Negative", "classmanifold_1_1_cross_section.html#a9a534b0377c9ca41983d53b0dae0d5a4affb9356ff2b7da85c75c92fa7ea03b8b", null ] + ] ], + [ "JoinType", "classmanifold_1_1_cross_section.html#aef400c43b34e3ecc3f7b342aa821395d", [ + [ "Square", "classmanifold_1_1_cross_section.html#aef400c43b34e3ecc3f7b342aa821395daceb46ca115d05c51aa5a16a8867c3304", null ], + [ "Round", "classmanifold_1_1_cross_section.html#aef400c43b34e3ecc3f7b342aa821395dab7f41fc1412ad2ee75e9b2635d3b9d5c", null ], + [ "Miter", "classmanifold_1_1_cross_section.html#aef400c43b34e3ecc3f7b342aa821395dae4396f81cd926bb129ccf3c147c64514", null ] + ] ], + [ "CrossSection", "classmanifold_1_1_cross_section.html#acbed403d82ee8d55f3be2c9a5f963ec0", null ], + [ "CrossSection", "classmanifold_1_1_cross_section.html#ada3a36554c48080ae963a9628de79436", null ], + [ "CrossSection", "classmanifold_1_1_cross_section.html#aca5659d6e02ee4583791b54285d682a2", null ], + [ "CrossSection", "classmanifold_1_1_cross_section.html#a885334a617ae0eea9402f74a20f4408e", null ], + [ "CrossSection", "classmanifold_1_1_cross_section.html#ad2f60f6e1e3d45e773a595a1be246cf2", null ], + [ "Area", "classmanifold_1_1_cross_section.html#ac84b151a969c68d662637e8245548666", null ], + [ "NumVert", "classmanifold_1_1_cross_section.html#a85b690c706c5e2c2c29e0ced0c2728ca", null ], + [ "NumContour", "classmanifold_1_1_cross_section.html#af73463c82eede09392aff17a7154a00c", null ], + [ "IsEmpty", "classmanifold_1_1_cross_section.html#a8e12342fc420701fbffd97025421575a", null ], + [ "Bounds", "classmanifold_1_1_cross_section.html#ae69af2b193a98c4adc6f613a7463482c", null ], + [ "Translate", "classmanifold_1_1_cross_section.html#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 ], + [ "WarpBatch", "classmanifold_1_1_cross_section.html#ae004e45467f97624c89465248f4ffda1", 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..16d05b99b --- /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..96bfdc0be --- /dev/null +++ b/docs/html/classmanifold_1_1_csg_leaf_node.html @@ -0,0 +1,294 @@ + + + + + + + +Manifold: CsgLeafNode Class Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
CsgLeafNode Class Referencefinal
+
+
+ +

Inherits CsgNode.

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

+Public Member Functions

CsgLeafNode (std::shared_ptr< const Manifold::Impl > pImpl_)
 
CsgLeafNode (std::shared_ptr< const Manifold::Impl > pImpl_, 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< 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..87d0ac48d --- /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..f5a8d7003 --- /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..47a0a973e --- /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..d27280af5 --- /dev/null +++ b/docs/html/classmanifold_1_1_csg_op_node.html @@ -0,0 +1,296 @@ + + + + + + + +Manifold: CsgOpNode Class Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
CsgOpNode Class Referencefinal
+
+
+ +

Inherits CsgNode.

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

+Public Member Functions

CsgOpNode (const std::vector< std::shared_ptr< CsgNode > > &children, OpType op)
 
CsgOpNode (std::vector< std::shared_ptr< CsgNode > > &&children, OpType op)
 
std::shared_ptr< CsgNodeBoolean (const std::shared_ptr< CsgNode > &second, OpType op) override
 
std::shared_ptr< CsgNodeTransform (const 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
+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..dc2b7362c --- /dev/null +++ b/docs/html/classmanifold_1_1_hash_table-members.html @@ -0,0 +1,124 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
HashTable< V, H > Member List
+
+
+ +

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

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

+Public Member Functions

HashTable (size_t size, uint32_t step=1)
 
HashTable (const HashTable &other)
 
+HashTableoperator= (const HashTable &other)
 
+HashTableD< V, HD ()
 
+int Entries () const
 
+size_t 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..4d8a8060e --- /dev/null +++ b/docs/html/classmanifold_1_1_hash_table_d-members.html @@ -0,0 +1,123 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
HashTableD< V, H > Member List
+
+
+ +

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

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

+Public Member Functions

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

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

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AsOriginal() constManifold
BatchBoolean(const std::vector< Manifold > &manifolds, OpType op)Manifoldstatic
Boolean(const Manifold &second, OpType op) constManifold
BoundingBox() constManifold
CalculateCurvature(int gaussianIdx, int meanIdx) constManifold
CalculateNormals(int normalIdx, float minSharpAngle=60) 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
MinGap(const Manifold &other, float searchLength) 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
Project() constManifold
Refine(int) constManifold
RefineToLength(float) 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
Slice(float height=0) constManifold
Smooth(const MeshGL &, const std::vector< Smoothness > &sharpenedEdges={})Manifoldstatic
Smooth(const Mesh &, const std::vector< Smoothness > &sharpenedEdges={})Manifoldstatic
SmoothByNormals(int normalIdx) constManifold
SmoothOut(float minSharpAngle=60, float minSmoothness=0) constManifold
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
WarpBatch(std::function< void(VecView< 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..415ddb77f --- /dev/null +++ b/docs/html/classmanifold_1_1_manifold.html @@ -0,0 +1,2053 @@ + + + + + + + +Manifold: Manifold Class Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
Manifold Class Reference
+
+
+ +

#include <manifold.h>

+ + + + +

+Classes

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

Information

Details of the manifold

+
enum class  Error {
+  NoError +, NonFiniteVertex +, NotManifold +, VertexOutOfBounds +,
+  PropertiesWrongLength +, MissingPositionProperties +, MergeVectorsDifferentLengths +, MergeIndexOutOfBounds +,
+  TransformWrongLength +, RunIndexWrongLength +, FaceIDWrongLength +, InvalidConstruction +
+ }
 
Mesh GetMesh () const
 
MeshGL GetMeshGL (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
 
float MinGap (const Manifold &other, float searchLength) const
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Creation

Constructors

+
 Manifold ()
 
Manifold (const Manifold &other)
 
+Manifoldoperator= (const Manifold &other)
 
Manifold (Manifold &&) noexcept
 
+Manifoldoperator= (Manifold &&) noexcept
 
 Manifold (const MeshGL &, const std::vector< float > &propertyTolerance={})
 
 Manifold (const Mesh &)
 
static Manifold Smooth (const MeshGL &, const std::vector< Smoothness > &sharpenedEdges={})
 
static Manifold Smooth (const Mesh &, const std::vector< Smoothness > &sharpenedEdges={})
 
static Manifold Tetrahedron ()
 
static Manifold Cube (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 WarpBatch (std::function< void(VecView< glm::vec3 >)>) const
 
Manifold SetProperties (int, std::function< void(float *, glm::vec3, const float *)>) const
 
Manifold CalculateCurvature (int gaussianIdx, int meanIdx) const
 
Manifold CalculateNormals (int normalIdx, float minSharpAngle=60) const
 
Manifold SmoothByNormals (int normalIdx) const
 
Manifold SmoothOut (float minSharpAngle=60, float minSmoothness=0) const
 
Manifold Refine (int) const
 
Manifold RefineToLength (float) 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)
 
+ + + + + +

2D from 3D

CrossSection Slice (float height=0) const
 
CrossSection Project () const
 
+ + + + + + + +

Convex hull

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

Testing hooks

These are just for internal testing.

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

Detailed Description

+

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

+

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

+

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

+

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

+

Constructor & Destructor Documentation

+ +

◆ Manifold() [1/3]

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

Construct an empty Manifold.

+ +
+
+ +

◆ Manifold() [2/3]

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

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

+

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

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

◆ Manifold() [3/3]

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

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

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

Member Function Documentation

+ +

◆ Smooth() [1/2]

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

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

+

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

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

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

+ +
+
+ +

◆ Smooth() [2/2]

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

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

+

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

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

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

+ +
+
+ +

◆ Tetrahedron()

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

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

+ +
+
+ +

◆ Cube()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
Manifold Cube (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. Note that scale is applied after twist. 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.

+ +
+
+ +

◆ MinGap()

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

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

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

◆ OriginalID()

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

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

+ +
+
+ +

◆ AsOriginal()

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

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

+ +
+
+ +

◆ ReserveIDs()

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

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

+ +
+
+ +

◆ Translate()

+ +
+
+ + + + + + + + +
Manifold Translate (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.
+
+
+ +
+
+ +

◆ WarpBatch()

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

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

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

◆ SetProperties()

+ +
+
+ + + + + + + + + + + + + + + + + + +
Manifold SetProperties (int ,
std::function< void(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.
+
+
+ +
+
+ +

◆ CalculateNormals()

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

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

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

◆ SmoothByNormals()

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

Smooths out the Manifold by filling in the halfedgeTangent vectors. The geometry will remain unchanged until Refine or RefineToLength is called to interpolate the surface. This version uses the supplied vertex normal properties to define the tangent vectors.

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

◆ SmoothOut()

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

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

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

◆ Refine()

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

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

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

◆ RefineToLength()

+ +
+
+ + + + + + + + +
Manifold RefineToLength (float length) const
+
+

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

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

◆ Boolean()

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

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

+

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

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

◆ BatchBoolean()

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

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

+ +
+
+ +

◆ operator+()

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

Shorthand for Boolean Union.

+ +
+
+ +

◆ operator+=()

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

Shorthand for Boolean Union assignment.

+ +
+
+ +

◆ operator-()

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

Shorthand for Boolean Difference.

+ +
+
+ +

◆ operator-=()

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

Shorthand for Boolean Difference assignment.

+ +
+
+ +

◆ operator^()

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

Shorthand for Boolean Intersection.

+ +
+
+ +

◆ operator^=()

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

Shorthand for Boolean Intersection assignment.

+ +
+
+ +

◆ Split()

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

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

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

◆ SplitByPlane()

+ +
+
+ + + + + + + + + + + + + + + + + + +
std::pair< Manifold, Manifold > SplitByPlane (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.
+
+
+ +
+
+ +

◆ Slice()

+ +
+
+ + + + + + + + +
CrossSection Slice (float height = 0) const
+
+

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

+ +
+
+ +

◆ Project()

+ +
+
+ + + + + + + +
CrossSection Project () const
+
+

Returns a cross section representing the projected outline of this object onto the X-Y plane.

+ +
+
+ +

◆ 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..d66851b7d --- /dev/null +++ b/docs/html/classmanifold_1_1_manifold.js @@ -0,0 +1,53 @@ +var classmanifold_1_1_manifold = +[ + [ "Manifold", "classmanifold_1_1_manifold.html#ad5f60691d05e3402630122740cdf3a0b", null ], + [ "Manifold", "classmanifold_1_1_manifold.html#a4bc17f3828311b81bf61c34805501599", null ], + [ "Manifold", "classmanifold_1_1_manifold.html#a3f761d66cf1aa619203bb7622a5f93ea", null ], + [ "Decompose", "classmanifold_1_1_manifold.html#a7f20b130779680156ce0d28d91e5d106", null ], + [ "GetMesh", "classmanifold_1_1_manifold.html#a74a906cf6aacd6c0aef61b5079a8c750", null ], + [ "GetMeshGL", "classmanifold_1_1_manifold.html#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 ], + [ "MinGap", "classmanifold_1_1_manifold.html#a4a193d3f0a8c3af87961a9161cb17c68", 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 ], + [ "WarpBatch", "classmanifold_1_1_manifold.html#a76546a15aa48f9a9064e7bfc7792c302", null ], + [ "SetProperties", "classmanifold_1_1_manifold.html#a1aaf5a6d1a3d8c22f1a2c57a653cc389", null ], + [ "CalculateCurvature", "classmanifold_1_1_manifold.html#a19abb297f7b7b43f5c84562bcc7df705", null ], + [ "CalculateNormals", "classmanifold_1_1_manifold.html#a69c1ea423ea019bb932e3f55d3f6ff50", null ], + [ "SmoothByNormals", "classmanifold_1_1_manifold.html#aa0cbb9710c375f40591c3ae2dd62f2b4", null ], + [ "SmoothOut", "classmanifold_1_1_manifold.html#a8ce7d02b7f16afb5e9bfb8a948e206d3", null ], + [ "Refine", "classmanifold_1_1_manifold.html#a5d9227a2d10d8ad7b005555213ecd1ac", null ], + [ "RefineToLength", "classmanifold_1_1_manifold.html#a4fa475bc00e8b7a8fe28eea6b2d0e69e", 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 ], + [ "Slice", "classmanifold_1_1_manifold.html#a8e75e8acf7a0cc2ef5cbe7c13a047c6a", null ], + [ "Project", "classmanifold_1_1_manifold.html#a839fddf7415bbad41114268f1c4d3c47", 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..ab0ed104f --- /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..b894e74c0 --- /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..6cfa01d0c --- /dev/null +++ b/docs/html/classmanifold_1_1_sparse_indices-members.html @@ -0,0 +1,135 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
SparseIndices Member List
+
+
+ +

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

+ + + + + + + + + + + + + + + + + + + + + + +
Add(int p, int q) (defined in SparseIndices)SparseIndicesinline
AsVec32() (defined in SparseIndices)SparseIndicesinline
AsVec32() const (defined in SparseIndices)SparseIndicesinline
AsVec64() (defined in SparseIndices)SparseIndicesinline
AsVec64() const (defined in SparseIndices)SparseIndicesinline
Copy(bool use_q) const (defined in SparseIndices)SparseIndicesinline
Dump() const (defined in SparseIndices)SparseIndicesinline
EncodePQ(int p, int q) (defined in SparseIndices)SparseIndicesinlinestatic
Get(size_t i, bool use_q) (defined in SparseIndices)SparseIndicesinline
Get(size_t i, bool use_q) const (defined in SparseIndices)SparseIndicesinline
GetPQ(size_t i) const (defined in SparseIndices)SparseIndicesinline
KeepFinite(Vec< T > &v, Vec< int > &x) (defined in SparseIndices)SparseIndicesinline
RemoveZeros(Vec< int > &S) (defined in SparseIndices)SparseIndicesinline
Resize(size_t size) (defined in SparseIndices)SparseIndicesinline
Set(size_t i, int p, int q) (defined in SparseIndices)SparseIndicesinline
SetPQ(size_t i, int64_t pq) (defined in SparseIndices)SparseIndicesinline
size() const (defined in SparseIndices)SparseIndicesinline
Sort() (defined in SparseIndices)SparseIndicesinline
SparseIndices()=default (defined in SparseIndices)SparseIndices
SparseIndices(size_t size) (defined in SparseIndices)SparseIndicesinline
Unique() (defined in SparseIndices)SparseIndicesinline
+
+ + + + diff --git a/docs/html/classmanifold_1_1_sparse_indices.html b/docs/html/classmanifold_1_1_sparse_indices.html new file mode 100644 index 000000000..30a986623 --- /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)
 
+size_t size () const
 
+Vec< intCopy (bool use_q) const
 
+void Sort ()
 
+void Resize (size_t size)
 
+intGet (size_t i, bool use_q)
 
+int Get (size_t i, bool use_q) const
 
+int64_t GetPQ (size_t i) const
 
+void Set (size_t i, int p, int q)
 
+void SetPQ (size_t i, int64_t pq)
 
+VecView< int64_tAsVec64 ()
 
+VecView< const int64_tAsVec64 () const
 
+VecView< int32_tAsVec32 ()
 
+VecView< const int32_tAsVec32 () 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..40c4c5958 --- /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(size_t offset=0, size_t length=std::numeric_limits< size_t >::max()) const (defined in Vec< T >)Vec< T >inline
data() (defined in Vec< T >)Vec< T >inline
data() const (defined in Vec< T >)Vec< T >inline
Dump() const (defined in VecView< T >)VecView< T >inline
empty() const (defined in VecView< T >)VecView< T >inline
end() const (defined in VecView< T >)VecView< T >inline
end() (defined in VecView< T >)VecView< T >inline
front() const (defined in VecView< T >)VecView< T >inline
front() (defined in VecView< T >)VecView< T >inline
Iter typedef (defined in VecView< T >)VecView< T >
IterC typedef (defined in VecView< T >)VecView< T >
operator VecView< const T >() const (defined in Vec< T >)Vec< T >inline
operator VecView< T >() (defined in Vec< T >)Vec< T >inline
operator VecView< T >() const (defined in Vec< T >)Vec< T >inline
operator=(const Vec< T > &other) (defined in Vec< T >)Vec< T >inline
operator=(Vec< T > &&other) (defined in Vec< T >)Vec< T >inline
operator=(const VecView &other) (defined in VecView< T >)VecView< T >inline
operator[](size_t i) const (defined in VecView< T >)VecView< T >inline
operator[](size_t i) (defined in VecView< T >)VecView< T >inline
ptr_ (defined in VecView< T >)VecView< T >protected
push_back(const T &val) (defined in Vec< T >)Vec< T >inline
reserve(size_t n) (defined in Vec< T >)Vec< T >inline
resize(size_t newSize, T val=T()) (defined in Vec< T >)Vec< T >inline
shrink_to_fit() (defined in Vec< T >)Vec< T >inline
size() const (defined in VecView< T >)VecView< T >inline
size_ (defined in VecView< T >)VecView< T >protected
swap(Vec< T > &other) (defined in Vec< T >)Vec< T >inline
Vec() (defined in Vec< T >)Vec< T >inline
Vec(size_t size) (defined in Vec< T >)Vec< T >inline
Vec(size_t size, T val) (defined in Vec< T >)Vec< T >inline
Vec(const Vec< T > &vec) (defined in Vec< T >)Vec< T >inline
Vec(const std::vector< T > &vec) (defined in Vec< T >)Vec< T >inline
Vec(Vec< T > &&vec) (defined in Vec< T >)Vec< T >inline
VecView(T *ptr_, size_t size_) (defined in VecView< T >)VecView< T >inline
VecView(const VecView &other) (defined in VecView< T >)VecView< T >inline
VecView()=default (defined in VecView< T >)VecView< T >protected
view(size_t offset=0, size_t length=std::numeric_limits< size_t >::max()) (defined in Vec< T >)Vec< T >inline
view(size_t offset=0, size_t length=std::numeric_limits< size_t >::max()) const (defined in Vec< T >)Vec< T >inline
~Vec() (defined in Vec< T >)Vec< T >inline
+
+ + + + diff --git a/docs/html/classmanifold_1_1_vec.html b/docs/html/classmanifold_1_1_vec.html new file mode 100644 index 000000000..19ab9bbb2 --- /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 (size_t size)
 
Vec (size_t 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 (size_t n)
 
+void resize (size_t newSize, T val=T())
 
+void shrink_to_fit ()
 
+VecView< Tview (size_t offset=0, size_t length=std::numeric_limits< size_t >::max())
 
+VecView< const Tcview (size_t offset=0, size_t length=std::numeric_limits< size_t >::max()) const
 
+VecView< const Tview (size_t offset=0, size_t length=std::numeric_limits< size_t >::max()) const
 
+Tdata ()
 
+const Tdata () const
 
- Public Member Functions inherited from VecView< T >
VecView (T *ptr_, size_t size_)
 
VecView (const VecView &other)
 
+VecViewoperator= (const VecView &other)
 
operator VecView< const T > () const
 
+const Toperator[] (size_t i) const
 
+Toperator[] (size_t i)
 
+IterC cbegin () const
 
+IterC cend () const
 
+IterC begin () const
 
+IterC end () const
 
+Iter begin ()
 
+Iter end ()
 
+const Tfront () const
 
+const Tback () const
 
+Tfront ()
 
+Tback ()
 
+size_t size () const
 
+bool empty () const
 
+void Dump () const
 
+ + + + + + + + + + + +

+Additional Inherited Members

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

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

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

#include <vec_view.h>

+ +

Inherited by Vec< int >, Vec< glm::vec3 >, Vec< manifold::Box >, Vec< thrust::pair< int, int > >, Vec< Uint64 >, Vec< V >, 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_, size_t size_)
 
VecView (const VecView &other)
 
+VecViewoperator= (const VecView &other)
 
operator VecView< const T > () const
 
+const Toperator[] (size_t i) const
 
+Toperator[] (size_t i)
 
+IterC cbegin () const
 
+IterC cend () const
 
+IterC begin () const
 
+IterC end () const
 
+Iter begin ()
 
+Iter end ()
 
+const Tfront () const
 
+const Tback () const
 
+Tfront ()
 
+Tback ()
 
+size_t size () const
 
+bool empty () const
 
+void Dump () const
 
+ + + + + +

+Protected Attributes

+Tptr_ = nullptr
 
+size_t size_ = 0
 
+

Detailed Description

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

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

+
+
+ + + + diff --git a/docs/html/classmanifold_1_1strided__range-members.html b/docs/html/classmanifold_1_1strided__range-members.html new file mode 100644 index 000000000..20bec59f8 --- /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..d0f99c909 --- /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..61445d844 --- /dev/null +++ b/docs/html/collider_8h_source.html @@ -0,0 +1,167 @@ + + + + + + + +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 {
+
42 return internalChildren_.empty() ? 0 : (NumInternal() + 1);
+
43 };
+
44};
+
+
45
+
46} // namespace manifold
+
Definition collider.h:23
+
SparseIndices Collisions(const VecView< const T > &queriesIn) const
Definition collider.cpp:302
+
void UpdateBoxes(const VecView< const Box > &leafBB)
Definition collider.cpp:340
+
bool Transform(glm::mat4x3)
Definition collider.cpp:360
+
Definition sparse.h:27
+
Definition vec.h:45
+
Definition vec_view.h:27
+
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..e89946b09 --- /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:40
+
FillRule
Definition cross_section.h:65
+
JoinType
Definition cross_section.h:114
+
Definition manifold.h:148
+
std::vector< glm::vec2 > SimplePolygon
Definition public.h:116
+
std::vector< SimplePolygon > Polygons
Definition public.h:124
+
Definition public.h:129
+
Definition public.h:167
+
OpType
Definition public.h:493
+
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:171
+
Definition manifold.h:47
+
Definition public.h:322
+
+
+ + + + diff --git a/docs/html/cross_8cpp_source.html b/docs/html/cross_8cpp_source.html new file mode 100644 index 000000000..801c204f8 --- /dev/null +++ b/docs/html/cross_8cpp_source.html @@ -0,0 +1,373 @@ + + + + + + + +Manifold: cross.cpp Source File + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
cross.cpp
+
+
+
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 <vector>
+
16
+
17#include "conv.h"
+
18#include "cross_section.h"
+
19#include "manifold.h"
+
20#include "public.h"
+
21#include "types.h"
+
22
+
23ManifoldCrossSection *manifold_cross_section_empty(void *mem) {
+
24 return to_c(new (mem) CrossSection());
+
25}
+
26
+
27ManifoldCrossSection *manifold_cross_section_copy(void *mem,
+
28 ManifoldCrossSection *cs) {
+
29 auto cross = *from_c(cs);
+
30 return to_c(new (mem) CrossSection(cross));
+
31}
+
32
+
33ManifoldCrossSection *manifold_cross_section_of_simple_polygon(
+
34 void *mem, ManifoldSimplePolygon *p, ManifoldFillRule fr) {
+
35 return to_c(new (mem) CrossSection(*from_c(p), from_c(fr)));
+
36}
+
37
+
38ManifoldCrossSection *manifold_cross_section_of_polygons(void *mem,
+
39 ManifoldPolygons *p,
+
40 ManifoldFillRule fr) {
+
41 return to_c(new (mem) CrossSection(*from_c(p), from_c(fr)));
+
42}
+
43
+
44ManifoldCrossSectionVec *manifold_cross_section_empty_vec(void *mem) {
+
45 return to_c(new (mem) CrossSectionVec());
+
46}
+
47
+
48ManifoldCrossSectionVec *manifold_cross_section_vec(void *mem, size_t sz) {
+
49 return to_c(new (mem) CrossSectionVec(sz));
+
50}
+
51
+
52void manifold_cross_section_vec_reserve(ManifoldCrossSectionVec *csv,
+
53 size_t sz) {
+
54 from_c(csv)->reserve(sz);
+
55}
+
56
+
57size_t manifold_cross_section_vec_length(ManifoldCrossSectionVec *csv) {
+
58 return from_c(csv)->size();
+
59}
+
60
+
61ManifoldCrossSection *manifold_cross_section_vec_get(
+
62 void *mem, ManifoldCrossSectionVec *csv, int idx) {
+
63 auto cs = (*from_c(csv))[idx];
+
64 return to_c(new (mem) CrossSection(cs));
+
65}
+
66
+
67void manifold_cross_section_vec_set(ManifoldCrossSectionVec *csv, int idx,
+
68 ManifoldCrossSection *cs) {
+
69 (*from_c(csv))[idx] = *from_c(cs);
+
70}
+
71
+
72void manifold_cross_section_vec_push_back(ManifoldCrossSectionVec *csv,
+
73 ManifoldCrossSection *cs) {
+
74 return from_c(csv)->push_back(*from_c(cs));
+
75}
+
76
+
77ManifoldCrossSection *manifold_cross_section_square(void *mem, float x, float y,
+
78 int center) {
+
79 auto cs = CrossSection::Square(glm::vec2(x, y), center);
+
80 return to_c(new (mem) CrossSection(cs));
+
81}
+
82
+
83ManifoldCrossSection *manifold_cross_section_circle(void *mem, float radius,
+
84 int circular_segments) {
+
85 auto cs = CrossSection::Circle(radius, circular_segments);
+
86 return to_c(new (mem) CrossSection(cs));
+
87}
+
88
+
89ManifoldCrossSection *manifold_cross_section_boolean(void *mem,
+
90 ManifoldCrossSection *a,
+
91 ManifoldCrossSection *b,
+
92 ManifoldOpType op) {
+
93 auto cs = from_c(a)->Boolean(*from_c(b), from_c(op));
+
94 return to_c(new (mem) CrossSection(cs));
+
95}
+
96
+
97ManifoldCrossSection *manifold_cross_section_batch_boolean(
+
98 void *mem, ManifoldCrossSectionVec *csv, ManifoldOpType op) {
+
99 auto cs = CrossSection::BatchBoolean(*from_c(csv), from_c(op));
+
100 return to_c(new (mem) CrossSection(cs));
+
101}
+
102
+
103ManifoldCrossSection *manifold_cross_section_union(void *mem,
+
104 ManifoldCrossSection *a,
+
105 ManifoldCrossSection *b) {
+
106 auto cs = (*from_c(a)) + (*from_c(b));
+
107 return to_c(new (mem) CrossSection(cs));
+
108}
+
109
+
110ManifoldCrossSection *manifold_cross_section_difference(
+
111 void *mem, ManifoldCrossSection *a, ManifoldCrossSection *b) {
+
112 auto cs = (*from_c(a)) - (*from_c(b));
+
113 return to_c(new (mem) CrossSection(cs));
+
114}
+
115
+
116ManifoldCrossSection *manifold_cross_section_intersection(
+
117 void *mem, ManifoldCrossSection *a, ManifoldCrossSection *b) {
+
118 auto cs = (*from_c(a)) ^ (*from_c(b));
+
119 return to_c(new (mem) CrossSection(cs));
+
120}
+
121
+
122ManifoldCrossSection *manifold_cross_section_hull(void *mem,
+
123 ManifoldCrossSection *cs) {
+
124 auto hulled = from_c(cs)->Hull();
+
125 return to_c(new (mem) CrossSection(hulled));
+
126}
+
127
+
128ManifoldCrossSection *manifold_cross_section_batch_hull(
+
129 void *mem, ManifoldCrossSectionVec *css) {
+
130 auto hulled = CrossSection::Hull(*from_c(css));
+
131 return to_c(new (mem) CrossSection(hulled));
+
132}
+
133
+
134ManifoldCrossSection *manifold_cross_section_hull_simple_polygon(
+
135 void *mem, ManifoldSimplePolygon *ps) {
+
136 auto hulled = CrossSection::Hull(*from_c(ps));
+
137 return to_c(new (mem) CrossSection(hulled));
+
138}
+
139
+
140ManifoldCrossSection *manifold_cross_section_hull_polygons(
+
141 void *mem, ManifoldPolygons *ps) {
+
142 auto hulled = CrossSection::Hull(*from_c(ps));
+
143 return to_c(new (mem) CrossSection(hulled));
+
144}
+
145
+
146ManifoldCrossSection *manifold_cross_section_translate(void *mem,
+
147 ManifoldCrossSection *cs,
+
148 float x, float y) {
+
149 auto translated = from_c(cs)->Translate(glm::vec2(x, y));
+
150 return to_c(new (mem) CrossSection(translated));
+
151}
+
152
+
153ManifoldCrossSection *manifold_cross_section_rotate(void *mem,
+
154 ManifoldCrossSection *cs,
+
155 float deg) {
+
156 auto rotated = from_c(cs)->Rotate(deg);
+
157 return to_c(new (mem) CrossSection(rotated));
+
158}
+
159
+
160ManifoldCrossSection *manifold_cross_section_scale(void *mem,
+
161 ManifoldCrossSection *cs,
+
162 float x, float y) {
+
163 auto scaled = from_c(cs)->Scale(glm::vec2(x, y));
+
164 return to_c(new (mem) CrossSection(scaled));
+
165}
+
166
+
167ManifoldCrossSection *manifold_cross_section_mirror(void *mem,
+
168 ManifoldCrossSection *cs,
+
169 float ax_x, float ax_y) {
+
170 auto mirrored = from_c(cs)->Mirror(glm::vec2(ax_x, ax_y));
+
171 return to_c(new (mem) CrossSection(mirrored));
+
172}
+
173
+
174ManifoldCrossSection *manifold_cross_section_transform(void *mem,
+
175 ManifoldCrossSection *cs,
+
176 float x1, float y1,
+
177 float x2, float y2,
+
178 float x3, float y3) {
+
179 auto mat = glm::mat3x2(x1, y1, x2, y2, x3, y3);
+
180 auto transformed = from_c(cs)->Transform(mat);
+
181 return to_c(new (mem) CrossSection(transformed));
+
182}
+
183
+
184ManifoldCrossSection *manifold_cross_section_warp(
+
185 void *mem, ManifoldCrossSection *cs, ManifoldVec2 (*fun)(float, float)) {
+
186 std::function<void(glm::vec2 & v)> warp = [fun](glm::vec2 &v) {
+
187 v = from_c(fun(v.x, v.y));
+
188 };
+
189 auto warped = from_c(cs)->Warp(warp);
+
190 return to_c(new (mem) CrossSection(warped));
+
191}
+
192
+
193ManifoldCrossSection *manifold_cross_section_simplify(void *mem,
+
194 ManifoldCrossSection *cs,
+
195 double epsilon) {
+
196 auto simplified = from_c(cs)->Simplify(epsilon);
+
197 return to_c(new (mem) CrossSection(simplified));
+
198}
+
199
+
200ManifoldCrossSection *manifold_cross_section_offset(
+
201 void *mem, ManifoldCrossSection *cs, double delta, ManifoldJoinType jt,
+
202 double miter_limit, int circular_segments) {
+
203 auto offset =
+
204 from_c(cs)->Offset(delta, from_c(jt), miter_limit, circular_segments);
+
205 return to_c(new (mem) CrossSection(offset));
+
206}
+
207
+
208double manifold_cross_section_area(ManifoldCrossSection *cs) {
+
209 return from_c(cs)->Area();
+
210}
+
211
+
212int manifold_cross_section_num_vert(ManifoldCrossSection *cs) {
+
213 return from_c(cs)->NumVert();
+
214}
+
215
+
216int manifold_cross_section_num_contour(ManifoldCrossSection *cs) {
+
217 return from_c(cs)->NumContour();
+
218}
+
219
+
220int manifold_cross_section_is_empty(ManifoldCrossSection *cs) {
+
221 return from_c(cs)->IsEmpty();
+
222}
+
223
+
224ManifoldRect *manifold_cross_section_bounds(void *mem,
+
225 ManifoldCrossSection *cs) {
+
226 auto rect = from_c(cs)->Bounds();
+
227 return to_c(new (mem) Rect(rect));
+
228}
+
229
+
230ManifoldPolygons *manifold_cross_section_to_polygons(void *mem,
+
231 ManifoldCrossSection *cs) {
+
232 auto ps = from_c(cs)->ToPolygons();
+
233 return to_c(new (mem) Polygons(ps));
+
234}
+
235
+
236ManifoldCrossSection *manifold_cross_section_compose(
+
237 void *mem, ManifoldCrossSectionVec *csv) {
+
238 auto cs = CrossSection::Compose(*from_c(csv));
+
239 return to_c(new (mem) CrossSection(cs));
+
240}
+
241
+
242ManifoldCrossSectionVec *manifold_cross_section_decompose(
+
243 void *mem, ManifoldCrossSection *cs) {
+
244 auto comps = from_c(cs)->Decompose();
+
245 return to_c(new (mem) CrossSectionVec(comps));
+
246}
+
Definition cross_section.h:40
+
Manifold Rotate(float xDegrees, float yDegrees=0.0f, float zDegrees=0.0f) const
Definition manifold.cpp:525
+
Manifold Transform(const glm::mat4x3 &) const
Definition manifold.cpp:537
+
std::vector< Manifold > Decompose() const
Definition constructors.cpp:466
+
int NumVert() const
Definition manifold.cpp:370
+
bool IsEmpty() const
Definition manifold.cpp:355
+
Manifold Mirror(glm::vec3) const
Definition manifold.cpp:549
+
Manifold Boolean(const Manifold &second, OpType op) const
Definition manifold.cpp:772
+
Manifold Hull() const
Definition manifold.cpp:939
+
Manifold Translate(glm::vec3) const
Definition manifold.cpp:499
+
Manifold Scale(glm::vec3) const
Definition manifold.cpp:509
+
Manifold Warp(std::function< void(glm::vec3 &)>) const
Definition manifold.cpp:567
+
std::vector< SimplePolygon > Polygons
Definition public.h:124
+
Definition types.h:43
+
Definition public.h:322
+
+
+ + + + diff --git a/docs/html/cross__section_8h_source.html b/docs/html/cross__section_8h_source.html new file mode 100644 index 000000000..954181a55 --- /dev/null +++ b/docs/html/cross__section_8h_source.html @@ -0,0 +1,275 @@ + + + + + + + +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#include "vec_view.h"
+
25
+
26namespace manifold {
+
27
+
32struct PathImpl;
+
33
+
+ +
41 public:
+
46
+ + +
49
+
50 CrossSection(const CrossSection& other);
+
51 CrossSection& operator=(const CrossSection& other);
+
52 CrossSection(CrossSection&&) noexcept;
+
53 CrossSection& operator=(CrossSection&&) noexcept;
+
54
+
55 // Adapted from Clipper2 docs:
+
56 // http://www.angusj.com/clipper2/Docs/Units/Clipper/Types/FillRule.htm
+
57 // (Copyright © 2010-2023 Angus Johnson)
+
+
65 enum class FillRule {
+
66 EvenOdd,
+
67 NonZero,
+
68 Positive,
+ +
70 };
+
+
71
+
72 CrossSection(const SimplePolygon& contour,
+
73 FillRule fillrule = FillRule::Positive);
+
74 CrossSection(const Polygons& contours,
+
75 FillRule fillrule = FillRule::Positive);
+
76 CrossSection(const Rect& rect);
+
77 static CrossSection Square(const glm::vec2 dims, bool center = false);
+
78 static CrossSection Circle(float radius, int circularSegments = 0);
+
80
+
85 double Area() const;
+
86 int NumVert() const;
+
87 int NumContour() const;
+
88 bool IsEmpty() const;
+
89 Rect Bounds() const;
+
91
+
95 CrossSection Translate(const glm::vec2 v) const;
+
96 CrossSection Rotate(float degrees) const;
+
97 CrossSection Scale(const glm::vec2 s) const;
+
98 CrossSection Mirror(const glm::vec2 ax) const;
+
99 CrossSection Transform(const glm::mat3x2& m) const;
+
100 CrossSection Warp(std::function<void(glm::vec2&)> warpFunc) const;
+ +
102 std::function<void(VecView<glm::vec2>)> warpFunc) const;
+
103 CrossSection Simplify(double epsilon = 1e-6) const;
+
104
+
105 // Adapted from Clipper2 docs:
+
106 // http://www.angusj.com/clipper2/Docs/Units/Clipper/Types/JoinType.htm
+
107 // (Copyright © 2010-2023 Angus Johnson)
+
+
114 enum class JoinType {
+
115 Square,
+
118 Round,
+
121 Miter
+
126 };
+
+
127
+
128 CrossSection Offset(double delta, JoinType jt, double miter_limit = 2.0,
+
129 int circularSegments = 0) const;
+
131
+
136 CrossSection Boolean(const CrossSection& second, OpType op) const;
+ +
138 const std::vector<CrossSection>& crossSections, OpType op);
+
139 CrossSection operator+(const CrossSection&) const;
+ +
141 CrossSection operator-(const CrossSection&) const;
+ +
143 CrossSection operator^(const CrossSection&) const;
+ +
146
+
150 static CrossSection Compose(std::vector<CrossSection>&);
+
151 std::vector<CrossSection> Decompose() const;
+
153
+
157 CrossSection Hull() const;
+
158 static CrossSection Hull(const std::vector<CrossSection>& crossSections);
+
159 static CrossSection Hull(const SimplePolygon poly);
+
160 static CrossSection Hull(const Polygons polys);
+
163
+
166 Polygons ToPolygons() const;
+
168
+
169 private:
+
170 mutable std::shared_ptr<const PathImpl> paths_;
+
171 mutable glm::mat3x2 transform_ = glm::mat3x2(1.0f);
+
172 CrossSection(std::shared_ptr<const PathImpl> paths);
+
173 std::shared_ptr<const PathImpl> GetPaths() const;
+
174};
+
+
176} // namespace manifold
+
Definition cross_section.h:40
+
CrossSection Boolean(const CrossSection &second, OpType op) const
Definition cross_section.cpp:363
+
CrossSection Translate(const glm::vec2 v) const
Definition cross_section.cpp:490
+
CrossSection & operator+=(const CrossSection &)
Definition cross_section.cpp:411
+
Polygons ToPolygons() const
Definition cross_section.cpp:781
+
CrossSection operator+(const CrossSection &) const
Definition cross_section.cpp:403
+
CrossSection operator^(const CrossSection &) const
Definition cross_section.cpp:436
+
CrossSection & operator-=(const CrossSection &)
Definition cross_section.cpp:428
+
std::vector< CrossSection > Decompose() const
Definition cross_section.cpp:462
+
CrossSection Warp(std::function< void(glm::vec2 &)> warpFunc) const
Definition cross_section.cpp:564
+
static CrossSection Compose(std::vector< CrossSection > &)
Definition cross_section.cpp:453
+
static CrossSection BatchBoolean(const std::vector< CrossSection > &crossSections, OpType op)
Definition cross_section.cpp:375
+
int NumVert() const
Definition cross_section.cpp:749
+
bool IsEmpty() const
Definition cross_section.cpp:767
+
CrossSection Offset(double delta, JoinType jt, double miter_limit=2.0, int circularSegments=0) const
Definition cross_section.cpp:662
+
CrossSection Rotate(float degrees) const
Definition cross_section.cpp:503
+
FillRule
Definition cross_section.h:65
+
@ 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:444
+
CrossSection Simplify(double epsilon=1e-6) const
Definition cross_section.cpp:616
+
CrossSection Hull() const
Definition cross_section.cpp:708
+
double Area() const
Definition cross_section.cpp:744
+
CrossSection()
Definition cross_section.cpp:216
+
static CrossSection Circle(float radius, int circularSegments=0)
Definition cross_section.cpp:346
+
CrossSection Mirror(const glm::vec2 ax) const
Definition cross_section.cpp:533
+
CrossSection WarpBatch(std::function< void(VecView< glm::vec2 >)> warpFunc) const
Definition cross_section.cpp:580
+
Rect Bounds() const
Definition cross_section.cpp:773
+
JoinType
Definition cross_section.h:114
+ + + +
CrossSection Scale(const glm::vec2 s) const
Definition cross_section.cpp:518
+
CrossSection operator-(const CrossSection &) const
Definition cross_section.cpp:420
+
CrossSection Transform(const glm::mat3x2 &m) const
Definition cross_section.cpp:549
+
int NumContour() const
Definition cross_section.cpp:762
+
Definition vec_view.h:27
+
std::vector< glm::vec2 > SimplePolygon
Definition public.h:116
+
std::vector< SimplePolygon > Polygons
Definition public.h:124
+
OpType
Definition public.h:493
+
Definition meshIO.h:20
+
Definition public.h:322
+
+
+ + + + diff --git a/docs/html/csg__tree_8h_source.html b/docs/html/csg__tree_8h_source.html new file mode 100644 index 000000000..629c6b1ec --- /dev/null +++ b/docs/html/csg__tree_8h_source.html @@ -0,0 +1,235 @@ + + + + + + + +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:156
+
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:493
+
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..4a8cb225d --- /dev/null +++ b/docs/html/dir_00240dc4a1a4845ae58be68fbad02d02.html @@ -0,0 +1,122 @@ + + + + + + + +Manifold: bindings Directory Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
bindings Directory Reference
+
+
+ + + + + + + + +

+Directories

 c
 
 python
 
 wasm
 
+
+
+ + + + diff --git a/docs/html/dir_01ba33e26ccdeaa7023e73de5893fd0d.html b/docs/html/dir_01ba33e26ccdeaa7023e73de5893fd0d.html new file mode 100644 index 000000000..c34e45f9b --- /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

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

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

+Files

 polygon_corpus.cpp
 
 test.h
 
+
+
+ + + + diff --git a/docs/html/dir_1510bd745cd29c20d24c27171ebe5ba5.html b/docs/html/dir_1510bd745cd29c20d24c27171ebe5ba5.html new file mode 100644 index 000000000..d41959baa --- /dev/null +++ b/docs/html/dir_1510bd745cd29c20d24c27171ebe5ba5.html @@ -0,0 +1,112 @@ + + + + + + + +Manifold: extras Directory Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
extras Directory Reference
+
+
+
+
+ + + + diff --git a/docs/html/dir_22436d21afed9fe2212ff99306573f86.html b/docs/html/dir_22436d21afed9fe2212ff99306573f86.html new file mode 100644 index 000000000..adb721150 --- /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

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

+Files

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

 manifold.h
 
+
+
+ + + + diff --git a/docs/html/dir_3957bb4ff7e260a3392ba94c066388d5.html b/docs/html/dir_3957bb4ff7e260a3392ba94c066388d5.html new file mode 100644 index 000000000..c1a286018 --- /dev/null +++ b/docs/html/dir_3957bb4ff7e260a3392ba94c066388d5.html @@ -0,0 +1,112 @@ + + + + + + + +Manifold: examples Directory Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples Directory Reference
+
+
+
+
+ + + + diff --git a/docs/html/dir_3a92f14bdf3dfaa79faab39cf7167cf2.html b/docs/html/dir_3a92f14bdf3dfaa79faab39cf7167cf2.html new file mode 100644 index 000000000..4071520aa --- /dev/null +++ b/docs/html/dir_3a92f14bdf3dfaa79faab39cf7167cf2.html @@ -0,0 +1,127 @@ + + + + + + + +Manifold: c Directory Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
c Directory Reference
+
+
+ + + + +

+Directories

 include
 
+ + + + + + + +

+Files

 box.cpp
 
 cross.cpp
 
 rect.cpp
 
+
+
+ + + + diff --git a/docs/html/dir_411139fb7c51b97947dc3f4c990fa2a8.html b/docs/html/dir_411139fb7c51b97947dc3f4c990fa2a8.html new file mode 100644 index 000000000..d23db89de --- /dev/null +++ b/docs/html/dir_411139fb7c51b97947dc3f4c990fa2a8.html @@ -0,0 +1,112 @@ + + + + + + + +Manifold: src Directory Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
src Directory Reference
+
+
+
+
+ + + + diff --git a/docs/html/dir_44bc45adee95d64f3fc07ac8632ac6e6.html b/docs/html/dir_44bc45adee95d64f3fc07ac8632ac6e6.html new file mode 100644 index 000000000..a9d8e603c --- /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

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

 cross_section.h
 
+
+
+ + + + diff --git a/docs/html/dir_4ffc793862454300142bae38e0ddddb6.html b/docs/html/dir_4ffc793862454300142bae38e0ddddb6.html new file mode 100644 index 000000000..820c61bed --- /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

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

 polygon.h
 
+
+
+ + + + diff --git a/docs/html/dir_5e1898e4b52372285d7fdfd9dda7fae4.html b/docs/html/dir_5e1898e4b52372285d7fdfd9dda7fae4.html new file mode 100644 index 000000000..8cf724c21 --- /dev/null +++ b/docs/html/dir_5e1898e4b52372285d7fdfd9dda7fae4.html @@ -0,0 +1,112 @@ + + + + + + + +Manifold: examples Directory Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples Directory Reference
+
+
+
+
+ + + + diff --git a/docs/html/dir_6505c5f6e79ee6ee4e199558e7ba5a4c.html b/docs/html/dir_6505c5f6e79ee6ee4e199558e7ba5a4c.html new file mode 100644 index 000000000..79ff40a0d --- /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

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

+Directories

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

+Files

 samples.h
 
+
+
+ + + + diff --git a/docs/html/dir_7b5d38f1875f1b693f62ca6a108a1129.html b/docs/html/dir_7b5d38f1875f1b693f62ca6a108a1129.html new file mode 100644 index 000000000..b6bd11176 --- /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

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

 include
 
 src
 
+
+
+ + + + diff --git a/docs/html/dir_950b68c6a47147ffcc51e04695da9a54.html b/docs/html/dir_950b68c6a47147ffcc51e04695da9a54.html new file mode 100644 index 000000000..8d704121b --- /dev/null +++ b/docs/html/dir_950b68c6a47147ffcc51e04695da9a54.html @@ -0,0 +1,112 @@ + + + + + + + +Manifold: src Directory Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
src Directory Reference
+
+
+
+
+ + + + diff --git a/docs/html/dir_9a5ac44fcbd860e3dcbe5a914a21114c.html b/docs/html/dir_9a5ac44fcbd860e3dcbe5a914a21114c.html new file mode 100644 index 000000000..794330064 --- /dev/null +++ b/docs/html/dir_9a5ac44fcbd860e3dcbe5a914a21114c.html @@ -0,0 +1,118 @@ + + + + + + + +Manifold: wasm Directory Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
wasm Directory Reference
+
+
+ + + + +

+Files

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

+Directories

 examples
 
+
+
+ + + + diff --git a/docs/html/dir_bee2aafd430f50c741cae4861fc3aab1.html b/docs/html/dir_bee2aafd430f50c741cae4861fc3aab1.html new file mode 100644 index 000000000..951599b6d --- /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..6281f26a5 --- /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

 conv.h
 
 manifoldc.h
 
 types.h
 
+
+
+ + + + diff --git a/docs/html/dir_c84e25c25e5bcb4e381881ddcc618a67.html b/docs/html/dir_c84e25c25e5bcb4e381881ddcc618a67.html new file mode 100644 index 000000000..64a66513d --- /dev/null +++ b/docs/html/dir_c84e25c25e5bcb4e381881ddcc618a67.html @@ -0,0 +1,112 @@ + + + + + + + +Manifold: src Directory Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
src Directory Reference
+
+
+
+
+ + + + diff --git a/docs/html/dir_cabb6060e29ffd5a04545f711b9f938a.html b/docs/html/dir_cabb6060e29ffd5a04545f711b9f938a.html new file mode 100644 index 000000000..378423ec6 --- /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

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

 sdf.h
 
+
+
+ + + + diff --git a/docs/html/dir_e600baf0cd831db43dc31cc567702ce1.html b/docs/html/dir_e600baf0cd831db43dc31cc567702ce1.html new file mode 100644 index 000000000..c0dd21791 --- /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

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

- a -

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

- b -

+
+
+ + + + diff --git a/docs/html/functions_c.html b/docs/html/functions_c.html new file mode 100644 index 000000000..f71df64a1 --- /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..e419d4308 --- /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..573a6be89 --- /dev/null +++ b/docs/html/functions_e.html @@ -0,0 +1,114 @@ + + + + + + + +Manifold: Class Members + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all documented class members with links to the class documentation for each member:
+ +

- e -

+
+
+ + + + diff --git a/docs/html/functions_enum.html b/docs/html/functions_enum.html new file mode 100644 index 000000000..8bd4835cf --- /dev/null +++ b/docs/html/functions_enum.html @@ -0,0 +1,112 @@ + + + + + + + +Manifold: Class Members - Enumerations + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all documented enums with links to the class documentation for each member:
+
+
+ + + + diff --git a/docs/html/functions_f.html b/docs/html/functions_f.html new file mode 100644 index 000000000..0f31c70a0 --- /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..4e9803518 --- /dev/null +++ b/docs/html/functions_func.html @@ -0,0 +1,294 @@ + + + + + + + +Manifold: Class Members - Functions + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all documented functions with links to the class documentation for each member:
+ +

- a -

+ + +

- b -

+ + +

- c -

+ + +

- d -

+ + +

- e -

+ + +

- f -

+ + +

- g -

+ + +

- h -

+ + +

- i -

+ + +

- 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..89201f958 --- /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..f7ec48ffe --- /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..33e5b77af --- /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..32c20c0f5 --- /dev/null +++ b/docs/html/functions_j.html @@ -0,0 +1,113 @@ + + + + + + + +Manifold: Class Members + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all documented class members with links to the class documentation for each member:
+ +

- j -

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

- m -

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

- p -

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

- r -

+
+
+ + + + diff --git a/docs/html/functions_s.html b/docs/html/functions_s.html new file mode 100644 index 000000000..69e85849b --- /dev/null +++ b/docs/html/functions_s.html @@ -0,0 +1,136 @@ + + + + + + + +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..b88d7d375 --- /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..d1adf55b4 --- /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..0411f192d --- /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..0d248357c --- /dev/null +++ b/docs/html/functions_vars.html @@ -0,0 +1,194 @@ + + + + + + + +Manifold: Class Members - Variables + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all documented variables with links to the class documentation for each member:
+ +

- c -

+ + +

- d -

+ + +

- f -

+ + +

- h -

+ + +

- i -

+ + +

- m -

+ + +

- n -

+ + +

- o -

+ + +

- p -

+ + +

- r -

+ + +

- s -

+ + +

- t -

+ + +

- v -

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

- w -

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

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

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

+Classes

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

+Typedefs

using SimplePolygon = std::vector< 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)
 
SVDSet SVD (glm::mat3 A)
 
float SpectralNorm (glm::mat3 A)
 
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.
 
+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 +
+ +
+
+ +

◆ manifold::SVDSet

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

The three matrices of a Singular Value Decomposition.

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

Typedef Documentation

+ +

◆ SimplePolygon

+ +
+
+ + + + +
using SimplePolygon = std::vector<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.
+ +
+
+ +

◆ SVD()

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

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

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

◆ SpectralNorm()

+ +
+
+ + + + + +
+ + + + + + + + +
float SpectralNorm (glm::mat3 A)
+
+inline
+
+

Returns the largest singular value of A.

+
Parameters
+ + +
AThe matrix to measure.
+
+
+ +
+
+
+
+ + + + diff --git a/docs/html/group___connections.js b/docs/html/group___connections.js new file mode 100644 index 000000000..616dd7b30 --- /dev/null +++ b/docs/html/group___connections.js @@ -0,0 +1,81 @@ +var group___connections = +[ + [ "MeshGL", "structmanifold_1_1_mesh_g_l.html", [ + [ "MeshGL", "structmanifold_1_1_mesh_g_l.html#a258a2922fc12421c9a5ebde99606d0ed", null ], + [ "NumVert", "structmanifold_1_1_mesh_g_l.html#a21b84c701fbe74b93047405e36073658", null ], + [ "NumTri", "structmanifold_1_1_mesh_g_l.html#a3361a5e76bdb57f495d6ed826b3294b6", null ], + [ "Merge", "structmanifold_1_1_mesh_g_l.html#a2078d075bef279041b67769e4197c254", null ], + [ "numProp", "structmanifold_1_1_mesh_g_l.html#adf2ac53615be5ed3bf9ce4665e81eb75", null ], + [ "vertProperties", "structmanifold_1_1_mesh_g_l.html#aa4312e60a8b813c1ceb0e4229a993983", null ], + [ "triVerts", "structmanifold_1_1_mesh_g_l.html#afe0601a32ce917d3324b430a34f5d118", null ], + [ "mergeFromVert", "structmanifold_1_1_mesh_g_l.html#a77a299604952d11f9859c85f6e7b0078", null ], + [ "mergeToVert", "structmanifold_1_1_mesh_g_l.html#aefcc49e01a1d6de7ce57830d55b66e9a", null ], + [ "runIndex", "structmanifold_1_1_mesh_g_l.html#a0a53d3053354c6a80b1164f4e87c3ab4", null ], + [ "runOriginalID", "structmanifold_1_1_mesh_g_l.html#aa67d01a9b240154a754945eca9fca3e0", null ], + [ "runTransform", "structmanifold_1_1_mesh_g_l.html#a2ea55ea45b4bd7ec973dcf2973abaa20", null ], + [ "faceID", "structmanifold_1_1_mesh_g_l.html#ac6e7182a9cef30c9644ee167fbff30e1", null ], + [ "halfedgeTangent", "structmanifold_1_1_mesh_g_l.html#a387df8d12d2307639b862c30efa7e5c5", null ], + [ "precision", "structmanifold_1_1_mesh_g_l.html#acd76b1c12cd41083eeef7b6f09c32141", null ] + ] ], + [ "Mesh", "group___connections.html#structmanifold_1_1_mesh", [ + [ "vertPos", "group___connections.html#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 ] + ] ], + [ "SVDSet", "group___connections.html#structmanifold_1_1_s_v_d_set", null ], + [ "SimplePolygon", "group___connections.html#ga53c298f15c33cb04ef759cec45eaecd1", null ], + [ "Polygons", "group___connections.html#ga60a66d8ddacc086bb45d8afc37f646d1", null ], + [ "Triangulate", "group___connections.html#ga1d01ff53289da0842e539ddf8cda5c96", null ], + [ "sind", "group___connections.html#gaf191247f966a40ecf3ee0fe9a717c0f3", null ], + [ "cosd", "group___connections.html#ga502f5a841d8d1fcba289e167a1177bda", null ], + [ "RotateUp", "group___connections.html#ga8997efa1e8a2c5fcc69314c863a8b6da", null ], + [ "CCW", "group___connections.html#ga20f946797231119dd2b7260c216cda31", null ], + [ "SVD", "group___connections.html#ga52654eb696e6ea2b67dcd45063d1724a", null ], + [ "SpectralNorm", "group___connections.html#ga50a9d6292886da472798354447a68cd7", 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..87575b308 --- /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..75b87f49f --- /dev/null +++ b/docs/html/group___core.js @@ -0,0 +1,100 @@ +var group___core = +[ + [ "CrossSection", "classmanifold_1_1_cross_section.html", [ + [ "FillRule", "classmanifold_1_1_cross_section.html#a9a534b0377c9ca41983d53b0dae0d5a4", [ + [ "EvenOdd", "classmanifold_1_1_cross_section.html#a9a534b0377c9ca41983d53b0dae0d5a4a8e586e4bd2c45e86222301f2e6e0e390", null ], + [ "NonZero", "classmanifold_1_1_cross_section.html#a9a534b0377c9ca41983d53b0dae0d5a4a3d0365a27a39c0af183445fc4d932a8a", null ], + [ "Positive", "classmanifold_1_1_cross_section.html#a9a534b0377c9ca41983d53b0dae0d5a4a3289297424e01eda5b788c083bbf3147", null ], + [ "Negative", "classmanifold_1_1_cross_section.html#a9a534b0377c9ca41983d53b0dae0d5a4affb9356ff2b7da85c75c92fa7ea03b8b", null ] + ] ], + [ "JoinType", "classmanifold_1_1_cross_section.html#aef400c43b34e3ecc3f7b342aa821395d", [ + [ "Square", "classmanifold_1_1_cross_section.html#aef400c43b34e3ecc3f7b342aa821395daceb46ca115d05c51aa5a16a8867c3304", null ], + [ "Round", "classmanifold_1_1_cross_section.html#aef400c43b34e3ecc3f7b342aa821395dab7f41fc1412ad2ee75e9b2635d3b9d5c", null ], + [ "Miter", "classmanifold_1_1_cross_section.html#aef400c43b34e3ecc3f7b342aa821395dae4396f81cd926bb129ccf3c147c64514", null ] + ] ], + [ "CrossSection", "classmanifold_1_1_cross_section.html#acbed403d82ee8d55f3be2c9a5f963ec0", null ], + [ "CrossSection", "classmanifold_1_1_cross_section.html#ada3a36554c48080ae963a9628de79436", null ], + [ "CrossSection", "classmanifold_1_1_cross_section.html#aca5659d6e02ee4583791b54285d682a2", null ], + [ "CrossSection", "classmanifold_1_1_cross_section.html#a885334a617ae0eea9402f74a20f4408e", null ], + [ "CrossSection", "classmanifold_1_1_cross_section.html#ad2f60f6e1e3d45e773a595a1be246cf2", null ], + [ "Area", "classmanifold_1_1_cross_section.html#ac84b151a969c68d662637e8245548666", null ], + [ "NumVert", "classmanifold_1_1_cross_section.html#a85b690c706c5e2c2c29e0ced0c2728ca", null ], + [ "NumContour", "classmanifold_1_1_cross_section.html#af73463c82eede09392aff17a7154a00c", null ], + [ "IsEmpty", "classmanifold_1_1_cross_section.html#a8e12342fc420701fbffd97025421575a", null ], + [ "Bounds", "classmanifold_1_1_cross_section.html#ae69af2b193a98c4adc6f613a7463482c", null ], + [ "Translate", "classmanifold_1_1_cross_section.html#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 ], + [ "WarpBatch", "classmanifold_1_1_cross_section.html#ae004e45467f97624c89465248f4ffda1", 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 ], + [ "MinGap", "classmanifold_1_1_manifold.html#a4a193d3f0a8c3af87961a9161cb17c68", 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 ], + [ "WarpBatch", "classmanifold_1_1_manifold.html#a76546a15aa48f9a9064e7bfc7792c302", null ], + [ "SetProperties", "classmanifold_1_1_manifold.html#a1aaf5a6d1a3d8c22f1a2c57a653cc389", null ], + [ "CalculateCurvature", "classmanifold_1_1_manifold.html#a19abb297f7b7b43f5c84562bcc7df705", null ], + [ "CalculateNormals", "classmanifold_1_1_manifold.html#a69c1ea423ea019bb932e3f55d3f6ff50", null ], + [ "SmoothByNormals", "classmanifold_1_1_manifold.html#aa0cbb9710c375f40591c3ae2dd62f2b4", null ], + [ "SmoothOut", "classmanifold_1_1_manifold.html#a8ce7d02b7f16afb5e9bfb8a948e206d3", null ], + [ "Refine", "classmanifold_1_1_manifold.html#a5d9227a2d10d8ad7b005555213ecd1ac", null ], + [ "RefineToLength", "classmanifold_1_1_manifold.html#a4fa475bc00e8b7a8fe28eea6b2d0e69e", 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 ], + [ "Slice", "classmanifold_1_1_manifold.html#a8e75e8acf7a0cc2ef5cbe7c13a047c6a", null ], + [ "Project", "classmanifold_1_1_manifold.html#a839fddf7415bbad41114268f1c4d3c47", null ], + [ "Hull", "classmanifold_1_1_manifold.html#a9dc9e00112e2b063cfa6fe8482b1afe8", null ], + [ "MatchesTriNormals", "classmanifold_1_1_manifold.html#a611a5fd95dc5d49cd88182b8ead722b7", null ], + [ "NumDegenerateTris", "classmanifold_1_1_manifold.html#afe3dd0baef775b394ee1a1ee0e353e66", null ], + [ "NumOverlaps", "classmanifold_1_1_manifold.html#a0dd36b29fdc9003280f6b1b96907b704", null ] + ] ], + [ "Quality", "classmanifold_1_1_quality.html", null ], + [ "OpType", "group___core.html#gaa1aa1c6a8f3bbed5b167bc2d4511b969", null ], + [ "LevelSet", "group___core.html#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..3c9af50f0 --- /dev/null +++ b/docs/html/group___debug.html @@ -0,0 +1,269 @@ + + + + + + + +Manifold: Debug + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
Debug
+
+
+ +

Debugging features. +More...

+ + + + + +

+Modules

 Exceptions
 Custom Exceptions.
 
+ + + +

+Classes

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

+Functions

ExecutionParamsManifoldParams ()
 
+template<typename T >
std::ostream & operator<< (std::ostream &stream, const glm::tvec2< T > &v)
 
+template<typename T >
std::ostream & operator<< (std::ostream &stream, const glm::tvec3< T > &v)
 
+template<typename T >
std::ostream & operator<< (std::ostream &stream, const glm::tvec4< T > &v)
 
+std::ostream & operator<< (std::ostream &stream, const glm::mat3 &mat)
 
+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()

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

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

+ +
+
+
+
+ + + + diff --git a/docs/html/group___debug.js b/docs/html/group___debug.js new file mode 100644 index 000000000..e0c6396b2 --- /dev/null +++ b/docs/html/group___debug.js @@ -0,0 +1,14 @@ +var group___debug = +[ + [ "Exceptions", "group___exceptions.html", "group___exceptions" ], + [ "ExecutionParams", "group___debug.html#structmanifold_1_1_execution_params", [ + [ "intermediateChecks", "group___debug.html#ae8dc7c8ba98011f6f2dbe1caddf2a6fb", null ], + [ "verbose", "group___debug.html#ab3f078684998b83967d507d0f453f454", null ], + [ "processOverlaps", "group___debug.html#a7166fd3caef3744f7241075f21f76af3", null ], + [ "suppressErrors", "group___debug.html#a48b673772893c29c426e98f8c84f0206", null ], + [ "deterministic", "group___debug.html#a02bda2c80b22d0c2507c7a74febb93bf", null ], + [ "cleanupTriangles", "group___debug.html#a85c1664e476e1da1b3d0973b3451857b", null ] + ] ], + [ "ManifoldParams", "group___debug.html#ga4a00dd8e8dff2c4f8a9105d1a5558275", null ], + [ "Dump", "group___debug.html#ga5a4ed9a6d64edb22079ff7a5caddcb5a", null ] +]; \ No newline at end of file diff --git a/docs/html/group___debug_structmanifold_1_1_execution_params.js b/docs/html/group___debug_structmanifold_1_1_execution_params.js new file mode 100644 index 000000000..95e902e24 --- /dev/null +++ b/docs/html/group___debug_structmanifold_1_1_execution_params.js @@ -0,0 +1,9 @@ +var group___debug_structmanifold_1_1_execution_params = +[ + [ "intermediateChecks", "group___debug.html#ae8dc7c8ba98011f6f2dbe1caddf2a6fb", null ], + [ "verbose", "group___debug.html#ab3f078684998b83967d507d0f453f454", null ], + [ "processOverlaps", "group___debug.html#a7166fd3caef3744f7241075f21f76af3", null ], + [ "suppressErrors", "group___debug.html#a48b673772893c29c426e98f8c84f0206", null ], + [ "deterministic", "group___debug.html#a02bda2c80b22d0c2507c7a74febb93bf", null ], + [ "cleanupTriangles", "group___debug.html#a85c1664e476e1da1b3d0973b3451857b", null ] +]; \ No newline at end of file diff --git a/docs/html/group___exceptions.html b/docs/html/group___exceptions.html new file mode 100644 index 000000000..c1593d05e --- /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..a5875f82f --- /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..6b02c8d68 --- /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 ] + ] ], + [ "ImportMesh", "group___mesh_i_o.html#ga6e6f86230549750f1d346db483fc30f0", null ], + [ "ExportMesh", "group___mesh_i_o.html#gac28a5cd14ebf185edff7a55c4efb5edb", null ], + [ "ExportMesh", "group___mesh_i_o.html#ga83ff5d8f4ee07ce7902b1d9ccea3640c", null ] +]; \ No newline at end of file diff --git a/docs/html/group___mesh_i_o_structmanifold_1_1_export_options.js b/docs/html/group___mesh_i_o_structmanifold_1_1_export_options.js new file mode 100644 index 000000000..4d736c18b --- /dev/null +++ b/docs/html/group___mesh_i_o_structmanifold_1_1_export_options.js @@ -0,0 +1,5 @@ +var group___mesh_i_o_structmanifold_1_1_export_options = +[ + [ "faceted", "group___mesh_i_o.html#a30d67be5305ec851cfd4e8e4a15c6d05", null ], + [ "mat", "group___mesh_i_o.html#ad16fe831da261fdf27e971c77c3e8a60", null ] +]; \ No newline at end of file diff --git a/docs/html/group___mesh_i_o_structmanifold_1_1_material.js b/docs/html/group___mesh_i_o_structmanifold_1_1_material.js new file mode 100644 index 000000000..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..586f7e007 --- /dev/null +++ b/docs/html/group___private.html @@ -0,0 +1,343 @@ + + + + + + + +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 >
 
+ + + + + +

+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.
 
+template<typename... Iters>
thrust::zip_iterator< thrust::tuple< Iters... > > zip (Iters... iters)
 
+template<typename A , typename B >
thrust::permutation_iterator< A, Bperm (A a, B b)
 
+template<typename T >
thrust::counting_iterator< TcountAt (T i)
 
+int Next3 (int i)
 
+int Prev3 (int i)
 
+template<typename T >
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::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..ad2945add --- /dev/null +++ b/docs/html/group___private.js @@ -0,0 +1,74 @@ +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 ], + [ "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#ab7abcb084ad024cb903caa4e4715f713", 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#ae2e222860f6cfa46e1c0e270d26f5976", null ], + [ "SimplifyTopology", "structmanifold_1_1_manifold_1_1_impl.html#a5814bb78c6aee8506a332d6cacf76af7", null ], + [ "SetNormals", "structmanifold_1_1_manifold_1_1_impl.html#a47e442af7d6655edf6dfef50cb958210", null ], + [ "CreateTangents", "structmanifold_1_1_manifold_1_1_impl.html#acc962337837219c991a414bf4033ef61", null ], + [ "CreateTangents", "structmanifold_1_1_manifold_1_1_impl.html#ace17948374ae1178c45e661c1b95cc8b", null ], + [ "Subdivide", "structmanifold_1_1_manifold_1_1_impl.html#abe4f5b3c2e601eb17c121dfd6c755445", null ] + ] ], + [ "Halfedge", "structmanifold_1_1_halfedge.html", null ], + [ "Barycentric", "group___private.html#structmanifold_1_1_barycentric", null ], + [ "TriRef", "structmanifold_1_1_tri_ref.html", [ + [ "meshID", "structmanifold_1_1_tri_ref.html#a3552b302dec169446141ae02c7a2dc12", null ], + [ "originalID", "structmanifold_1_1_tri_ref.html#aa09887a4f79bfc78615dbd09d9001fd7", null ], + [ "tri", "structmanifold_1_1_tri_ref.html#a15e0e24263c3a2cc742b9cfcbabedf88", null ] + ] ], + [ "TmpEdge", "structmanifold_1_1_tmp_edge.html", null ], + [ "PolyVert", "group___private.html#structmanifold_1_1_poly_vert", [ + [ "pos", "group___private.html#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 ], + [ "GetAxisAlignedProjection", "group___private.html#ga95945ec21500a4c02b449357b3ef57ec", null ], + [ "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___samples.html b/docs/html/group___samples.html new file mode 100644 index 000000000..cb612be78 --- /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..057840a6f --- /dev/null +++ b/docs/html/group___samples.js @@ -0,0 +1,10 @@ +var group___samples = +[ + [ "TorusKnot", "group___samples.html#ga1937d6fee956f401ad9a3c9c2dc6eae2", null ], + [ "StretchyBracelet", "group___samples.html#gaa093ef8b44f049141ccbaca556f88cd3", null ], + [ "MengerSponge", "group___samples.html#ga31bc13b03579ca41da7ae9b5ba171fae", null ], + [ "RoundedFrame", "group___samples.html#ga8d224b44ea69ea070ebad60e6c1abbb9", null ], + [ "TetPuzzle", "group___samples.html#ga49162c3a42d672758d14855ad23258b9", null ], + [ "Scallop", "group___samples.html#ga45f5b5c2a374a8c67d9208a2bf9acc36", null ], + [ "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..f7baf31cc --- /dev/null +++ b/docs/html/hashtable_8h_source.html @@ -0,0 +1,289 @@ + + + + + + + +Manifold: hashtable.h Source File + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
hashtable.h
+
+
+
1// Copyright 2022 The Manifold Authors.
+
2//
+
3// Licensed under the Apache License, Version 2.0 (the "License");
+
4// you may not use this file except in compliance with the License.
+
5// You may obtain a copy of the License at
+
6//
+
7// http://www.apache.org/licenses/LICENSE-2.0
+
8//
+
9// Unless required by applicable law or agreed to in writing, software
+
10// distributed under the License is distributed on an "AS IS" BASIS,
+
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+
12// See the License for the specific language governing permissions and
+
13// limitations under the License.
+
14#pragma once
+
15#include <stdint.h>
+
16
+
17#include <atomic>
+
18
+
19#include "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, std::atomic<size_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 {
+
73 return used_.load(std::memory_order_relaxed) * 2 > Size();
+
74 }
+
75
+
76 void Insert(Uint64 key, const V& val) {
+
77 uint32_t idx = H(key) & (Size() - 1);
+
78 while (1) {
+
79 if (Full()) return;
+
80 Uint64& k = keys_[idx];
+
81 const Uint64 found = AtomicCAS(k, kOpen, key);
+
82 if (found == kOpen) {
+
83 used_.fetch_add(1, std::memory_order_relaxed);
+
84 values_[idx] = val;
+
85 return;
+
86 }
+
87 if (found == key) return;
+
88 idx = (idx + step_) & (Size() - 1);
+
89 }
+
90 }
+
91
+
92 V& operator[](Uint64 key) {
+
93 uint32_t idx = H(key) & (Size() - 1);
+
94 while (1) {
+
95 const Uint64 k = AtomicLoad(keys_[idx]);
+
96 if (k == key || k == kOpen) {
+
97 return values_[idx];
+
98 }
+
99 idx = (idx + step_) & (Size() - 1);
+
100 }
+
101 }
+
102
+
103 const V& operator[](Uint64 key) const {
+
104 uint32_t idx = H(key) & (Size() - 1);
+
105 while (1) {
+
106 const Uint64 k = AtomicLoad(keys_[idx]);
+
107 if (k == key || k == kOpen) {
+
108 return values_[idx];
+
109 }
+
110 idx = (idx + step_) & (Size() - 1);
+
111 }
+
112 }
+
113
+
114 Uint64 KeyAt(int idx) const { return AtomicLoad(keys_[idx]); }
+
115 V& At(int idx) { return values_[idx]; }
+
116 const V& At(int idx) const { return values_[idx]; }
+
117
+
118 private:
+
119 uint32_t step_;
+
120 VecView<Uint64> keys_;
+
121 VecView<V> values_;
+
122 std::atomic<size_t>& used_;
+
123};
+
+
124
+
125template <typename V, hash_fun_t H = hash64bit>
+
+ +
127 public:
+
128 HashTable(size_t size, uint32_t step = 1)
+
129 : keys_{size == 0 ? 0 : 1_z << (int)ceil(log2(size)), kOpen},
+
130 values_{size == 0 ? 0 : 1_z << (int)ceil(log2(size)), {}},
+
131 step_(step) {}
+
132
+ +
134 : keys_(other.keys_),
+
135 values_(other.values_),
+
136 used_(other.used_),
+
137 step_(other.step_) {}
+
138
+
139 HashTable& operator=(const HashTable& other) {
+
140 if (this == &other) return *this;
+
141 keys_ = other.keys_;
+
142 values_ = other.values_;
+
143 used_.store(other.used_.load());
+
144 step_ = other.step_;
+
145 return *this;
+
146 }
+
147
+
148 HashTableD<V, H> D() { return {keys_, values_, used_, step_}; }
+
149
+
150 int Entries() const { return used_.load(std::memory_order_relaxed); }
+
151
+
152 size_t Size() const { return keys_.size(); }
+
153
+
154 bool Full() const {
+
155 return used_.load(std::memory_order_relaxed) * 2 > Size();
+
156 }
+
157
+
158 float FilledFraction() const {
+
159 return static_cast<float>(used_.load(std::memory_order_relaxed)) / Size();
+
160 }
+
161
+
162 Vec<V>& GetValueStore() { return values_; }
+
163
+
164 static Uint64 Open() { return kOpen; }
+
165
+
166 private:
+
167 Vec<Uint64> keys_;
+
168 Vec<V> values_;
+
169 std::atomic<size_t> used_ = 0;
+
170 uint32_t step_;
+
171};
+
+
172
+
174} // namespace manifold
+
Definition hashtable.h:64
+
Definition hashtable.h:126
+
Definition vec_view.h:27
+
Definition meshIO.h:20
+
+
+ + + + diff --git a/docs/html/helpers_8cpp_source.html b/docs/html/helpers_8cpp_source.html new file mode 100644 index 000000000..78b1a57e1 --- /dev/null +++ b/docs/html/helpers_8cpp_source.html @@ -0,0 +1,367 @@ + + + + + + + +Manifold: helpers.cpp Source File + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
helpers.cpp
+
+
+
1#include <emscripten/bind.h>
+
2#include <emscripten/val.h>
+
3
+
4#include <vector>
+
5
+
6#include "cross_section.h"
+
7#include "manifold.h"
+
8#include "polygon.h"
+
9#include "sdf.h"
+
10
+
11using namespace emscripten;
+
12using namespace manifold;
+
13
+
14namespace js {
+
15val MeshGL2JS(const MeshGL& mesh) {
+
16 val meshJS = val::object();
+
17
+
18 meshJS.set("numProp", mesh.numProp);
+
19 meshJS.set("triVerts",
+
20 val(typed_memory_view(mesh.triVerts.size(), mesh.triVerts.data()))
+
21 .call<val>("slice"));
+
22 meshJS.set("vertProperties",
+
23 val(typed_memory_view(mesh.vertProperties.size(),
+
24 mesh.vertProperties.data()))
+
25 .call<val>("slice"));
+
26 meshJS.set("mergeFromVert", val(typed_memory_view(mesh.mergeFromVert.size(),
+
27 mesh.mergeFromVert.data()))
+
28 .call<val>("slice"));
+
29 meshJS.set("mergeToVert", val(typed_memory_view(mesh.mergeToVert.size(),
+
30 mesh.mergeToVert.data()))
+
31 .call<val>("slice"));
+
32 meshJS.set("runIndex",
+
33 val(typed_memory_view(mesh.runIndex.size(), mesh.runIndex.data()))
+
34 .call<val>("slice"));
+
35 meshJS.set("runOriginalID", val(typed_memory_view(mesh.runOriginalID.size(),
+
36 mesh.runOriginalID.data()))
+
37 .call<val>("slice"));
+
38 meshJS.set("faceID",
+
39 val(typed_memory_view(mesh.faceID.size(), mesh.faceID.data()))
+
40 .call<val>("slice"));
+
41 meshJS.set("halfedgeTangent",
+
42 val(typed_memory_view(mesh.halfedgeTangent.size(),
+
43 mesh.halfedgeTangent.data()))
+
44 .call<val>("slice"));
+
45 meshJS.set("runTransform", val(typed_memory_view(mesh.runTransform.size(),
+
46 mesh.runTransform.data()))
+
47 .call<val>("slice"));
+
48
+
49 return meshJS;
+
50}
+
51
+
52MeshGL MeshJS2GL(const val& mesh) {
+
53 MeshGL out;
+
54 out.numProp = mesh["numProp"].as<int>();
+
55 out.triVerts = convertJSArrayToNumberVector<uint32_t>(mesh["triVerts"]);
+
56 out.vertProperties =
+
57 convertJSArrayToNumberVector<float>(mesh["vertProperties"]);
+
58 if (mesh["mergeFromVert"] != val::undefined()) {
+
59 out.mergeFromVert =
+
60 convertJSArrayToNumberVector<uint32_t>(mesh["mergeFromVert"]);
+
61 }
+
62 if (mesh["mergeToVert"] != val::undefined()) {
+
63 out.mergeToVert =
+
64 convertJSArrayToNumberVector<uint32_t>(mesh["mergeToVert"]);
+
65 }
+
66 if (mesh["runIndex"] != val::undefined()) {
+
67 out.runIndex = convertJSArrayToNumberVector<uint32_t>(mesh["runIndex"]);
+
68 }
+
69 if (mesh["runOriginalID"] != val::undefined()) {
+
70 out.runOriginalID =
+
71 convertJSArrayToNumberVector<uint32_t>(mesh["runOriginalID"]);
+
72 }
+
73 if (mesh["faceID"] != val::undefined()) {
+
74 out.faceID = convertJSArrayToNumberVector<uint32_t>(mesh["faceID"]);
+
75 }
+
76 if (mesh["halfedgeTangent"] != val::undefined()) {
+
77 out.halfedgeTangent =
+
78 convertJSArrayToNumberVector<float>(mesh["halfedgeTangent"]);
+
79 }
+
80 if (mesh["runTransform"] != val::undefined()) {
+
81 out.runTransform =
+
82 convertJSArrayToNumberVector<float>(mesh["runTransform"]);
+
83 }
+
84 return out;
+
85}
+
86
+
87val GetMeshJS(const Manifold& manifold, const glm::ivec3& normalIdx) {
+
88 MeshGL mesh = manifold.GetMeshGL(normalIdx);
+
89 return MeshGL2JS(mesh);
+
90}
+
91
+
92val Merge(const val& mesh) {
+
93 val out = val::object();
+
94 MeshGL meshGL = MeshJS2GL(mesh);
+
95 bool changed = meshGL.Merge();
+
96 out.set("changed", changed);
+
97 out.set("mesh", changed ? MeshGL2JS(meshGL) : mesh);
+
98 return out;
+
99}
+
100
+
101Manifold Smooth(const val& mesh,
+
102 const std::vector<Smoothness>& sharpenedEdges = {}) {
+
103 return Manifold::Smooth(MeshJS2GL(mesh), sharpenedEdges);
+
104}
+
105
+
106} // namespace js
+
107
+
108namespace cross_js {
+
109CrossSection OfPolygons(std::vector<std::vector<glm::vec2>> polygons,
+
110 int fill_rule) {
+
111 auto fr = fill_rule == 0 ? CrossSection::FillRule::EvenOdd
+
112 : fill_rule == 1 ? CrossSection::FillRule::NonZero
+
113 : fill_rule == 2 ? CrossSection::FillRule::Positive
+
114 : CrossSection::FillRule::Negative;
+
115 return CrossSection(polygons, fr);
+
116}
+
117
+
118CrossSection Union(const CrossSection& a, const CrossSection& b) {
+
119 return a + b;
+
120}
+
121
+
122CrossSection Difference(const CrossSection& a, const CrossSection& b) {
+
123 return a - b;
+
124}
+
125
+
126CrossSection Intersection(const CrossSection& a, const CrossSection& b) {
+
127 return a ^ b;
+
128}
+
129
+
130CrossSection UnionN(const std::vector<CrossSection>& cross_sections) {
+
131 return CrossSection::BatchBoolean(cross_sections, OpType::Add);
+
132}
+
133
+
134CrossSection DifferenceN(const std::vector<CrossSection>& cross_sections) {
+
135 return CrossSection::BatchBoolean(cross_sections, OpType::Subtract);
+
136}
+
137
+
138CrossSection IntersectionN(const std::vector<CrossSection>& cross_sections) {
+
139 return CrossSection::BatchBoolean(cross_sections, OpType::Intersect);
+
140}
+
141
+
142CrossSection Transform(CrossSection& cross_section, const val& mat) {
+
143 std::vector<float> array = convertJSArrayToNumberVector<float>(mat);
+
144 glm::mat3x2 matrix;
+
145 for (const int col : {0, 1, 2})
+
146 for (const int row : {0, 1}) matrix[col][row] = array[col * 3 + row];
+
147 return cross_section.Transform(matrix);
+
148}
+
149
+
150CrossSection Warp(CrossSection& cross_section, uintptr_t funcPtr) {
+
151 void (*f)(glm::vec2&) = reinterpret_cast<void (*)(glm::vec2&)>(funcPtr);
+
152 return cross_section.Warp(f);
+
153}
+
154
+
155CrossSection Offset(CrossSection& cross_section, double delta, int join_type,
+
156 double miter_limit, double arc_tolerance) {
+
157 auto jt = join_type == 0 ? CrossSection::JoinType::Square
+
158 : join_type == 1 ? CrossSection::JoinType::Round
+
159 : CrossSection::JoinType::Miter;
+
160 return cross_section.Offset(delta, jt, miter_limit, arc_tolerance);
+
161}
+
162
+
163void CollectVertices(std::vector<glm::vec2>& verts, const CrossSection& cs) {
+
164 auto polys = cs.ToPolygons();
+
165 for (auto poly : polys) verts.insert(verts.end(), poly.begin(), poly.end());
+
166}
+
167} // namespace cross_js
+
168
+
169namespace man_js {
+
170Manifold FromMeshJS(const val& mesh) { return Manifold(js::MeshJS2GL(mesh)); }
+
171
+
172Manifold Union(const Manifold& a, const Manifold& b) { return a + b; }
+
173
+
174Manifold Difference(const Manifold& a, const Manifold& b) { return a - b; }
+
175
+
176Manifold Intersection(const Manifold& a, const Manifold& b) { return a ^ b; }
+
177
+
178Manifold UnionN(const std::vector<Manifold>& manifolds) {
+
179 return Manifold::BatchBoolean(manifolds, OpType::Add);
+
180}
+
181
+
182Manifold DifferenceN(const std::vector<Manifold>& manifolds) {
+
183 return Manifold::BatchBoolean(manifolds, OpType::Subtract);
+
184}
+
185
+
186Manifold IntersectionN(const std::vector<Manifold>& manifolds) {
+
187 return Manifold::BatchBoolean(manifolds, OpType::Intersect);
+
188}
+
189
+
190Manifold Transform(Manifold& manifold, const val& mat) {
+
191 std::vector<float> array = convertJSArrayToNumberVector<float>(mat);
+
192 glm::mat4x3 matrix;
+
193 for (const int col : {0, 1, 2, 3})
+
194 for (const int row : {0, 1, 2}) matrix[col][row] = array[col * 4 + row];
+
195 return manifold.Transform(matrix);
+
196}
+
197
+
198Manifold Warp(Manifold& manifold, uintptr_t funcPtr) {
+
199 void (*f)(glm::vec3&) = reinterpret_cast<void (*)(glm::vec3&)>(funcPtr);
+
200 return manifold.Warp(f);
+
201}
+
202
+
203Manifold SetProperties(Manifold& manifold, int numProp, uintptr_t funcPtr) {
+
204 void (*f)(float*, glm::vec3, const float*) =
+
205 reinterpret_cast<void (*)(float*, glm::vec3, const float*)>(funcPtr);
+
206 return manifold.SetProperties(numProp, f);
+
207}
+
208
+
209Manifold LevelSet(uintptr_t funcPtr, Box bounds, float edgeLength,
+
210 float level) {
+
211 float (*f)(const glm::vec3&) =
+
212 reinterpret_cast<float (*)(const glm::vec3&)>(funcPtr);
+
213 Mesh m = LevelSet(f, bounds, edgeLength, level);
+
214 return Manifold(m);
+
215}
+
216
+
217std::vector<Manifold> Split(Manifold& a, Manifold& b) {
+
218 auto [r1, r2] = a.Split(b);
+
219 return {r1, r2};
+
220}
+
221
+
222std::vector<Manifold> SplitByPlane(Manifold& m, glm::vec3 normal,
+
223 float originOffset) {
+
224 auto [a, b] = m.SplitByPlane(normal, originOffset);
+
225 return {a, b};
+
226}
+
227
+
228void CollectVertices(std::vector<glm::vec3>& verts, const Manifold& manifold) {
+
229 Mesh mesh = manifold.GetMesh();
+
230 verts.insert(verts.end(), mesh.vertPos.begin(), mesh.vertPos.end());
+
231}
+
232} // namespace man_js
+
Definition cross_section.h:40
+
Polygons ToPolygons() const
Definition cross_section.cpp:781
+
CrossSection Warp(std::function< void(glm::vec2 &)> warpFunc) const
Definition cross_section.cpp:564
+
CrossSection Offset(double delta, JoinType jt, double miter_limit=2.0, int circularSegments=0) const
Definition cross_section.cpp:662
+
CrossSection Transform(const glm::mat3x2 &m) const
Definition cross_section.cpp:549
+
Definition manifold.h:148
+
std::pair< Manifold, Manifold > Split(const Manifold &) const
Definition manifold.cpp:844
+
std::pair< Manifold, Manifold > SplitByPlane(glm::vec3 normal, float originOffset) const
Definition manifold.cpp:865
+
Definition public.h:129
+
Definition meshIO.h:20
+
Definition public.h:171
+
Definition manifold.h:47
+
std::vector< uint32_t > runIndex
Definition manifold.h:81
+
bool Merge()
Definition sort.cpp:519
+
std::vector< float > runTransform
Definition manifold.h:92
+
std::vector< float > halfedgeTangent
Definition manifold.h:105
+
std::vector< uint32_t > mergeFromVert
Definition manifold.h:72
+
std::vector< float > vertProperties
Definition manifold.h:66
+
std::vector< uint32_t > runOriginalID
Definition manifold.h:87
+
std::vector< uint32_t > faceID
Definition manifold.h:100
+
uint32_t numProp
Number of properties per vertex, always >= 3.
Definition manifold.h:62
+
std::vector< uint32_t > mergeToVert
Definition manifold.h:76
+
std::vector< uint32_t > triVerts
Definition manifold.h:69
+
+
+ + + + diff --git a/docs/html/hierarchy.html b/docs/html/hierarchy.html new file mode 100644 index 000000000..ba1898945 --- /dev/null +++ b/docs/html/hierarchy.html @@ -0,0 +1,215 @@ + + + + + + + +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 >
 Cglm_name< T >
 Cglm_name< glm::ivec3 >
 Cglm_name< glm::mat3x2 >
 Cglm_name< glm::mat4x3 >
 Cglm_name< glm::vec2 >
 Cglm_name< glm::vec3 >
 CGyroidSDF
 CHalfedge
 CHalfedge2Tmp
 Chash< glm::ivec3 >
 Chash< std::pair< int, int > >
 CHashTable< V, H >
 CHashTableD< V, H >
 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 >
 CSVDSet
 CTimer
 CTmpEdge
 CTmpInvalid
 CTriRef
 Ctype_caster< glm::mat< C, R, T, Q > >
 Ctype_caster< glm::vec< N, T, Q > >
 Ctype_caster< manifold::VecView< glm::vec< N, T, Q > > >
 Ctype_caster< std::vector< glm::vec< N, T, Q > > >
 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< 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< Uint64 >
 CVecView< unsigned char >
 CVecView< V >
+
+
+
+ + + + diff --git a/docs/html/hierarchy.js b/docs/html/hierarchy.js new file mode 100644 index 000000000..a43580f78 --- /dev/null +++ b/docs/html/hierarchy.js @@ -0,0 +1,108 @@ +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 ], + [ "firstNonFinite< T >", "structmanifold_1_1_sparse_indices_1_1first_non_finite.html", null ], + [ "glm_name< T >", "structglm__name.html", null ], + [ "glm_name< glm::ivec3 >", "structglm__name_3_01glm_1_1ivec3_01_4.html", null ], + [ "glm_name< glm::mat3x2 >", "structglm__name_3_01glm_1_1mat3x2_01_4.html", null ], + [ "glm_name< glm::mat4x3 >", "structglm__name_3_01glm_1_1mat4x3_01_4.html", null ], + [ "glm_name< glm::vec2 >", "structglm__name_3_01glm_1_1vec2_01_4.html", null ], + [ "glm_name< glm::vec3 >", "structglm__name_3_01glm_1_1vec3_01_4.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< glm::ivec3 >", "structstd_1_1hash_3_01glm_1_1ivec3_01_4.html", null ], + [ "hash< std::pair< int, int > >", "structstd_1_1hash_3_01std_1_1pair_3_01int_00_01int_01_4_01_4.html", null ], + [ "HashTable< V, H >", "classmanifold_1_1_hash_table.html", null ], + [ "HashTableD< V, H >", "classmanifold_1_1_hash_table_d.html", null ], + [ "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 ], + [ "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 ], + [ "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 ] + ] ], + [ "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 ], + [ "SVDSet", "group___connections.html#structmanifold_1_1_s_v_d_set", null ], + [ "Timer", "structmanifold_1_1_timer.html", null ], + [ "TmpEdge", "structmanifold_1_1_tmp_edge.html", null ], + [ "TmpInvalid", "structmanifold_1_1_tmp_invalid.html", null ], + [ "TriRef", "structmanifold_1_1_tri_ref.html", null ], + [ "type_caster< glm::mat< C, R, T, Q > >", "structnb_1_1detail_1_1type__caster_3_01glm_1_1mat_3_01_c_00_01_r_00_01_t_00_01_q_01_4_01_4.html", null ], + [ "type_caster< glm::vec< N, T, Q > >", "structnb_1_1detail_1_1type__caster_3_01glm_1_1vec_3_01_n_00_01_t_00_01_q_01_4_01_4.html", null ], + [ "type_caster< manifold::VecView< glm::vec< N, T, Q > > >", "structnb_1_1detail_1_1type__caster_3_01manifold_1_1_vec_view_3_01glm_1_1vec_3_01_n_00_01_t_00_01_q_01_4_01_4_01_4.html", null ], + [ "type_caster< std::vector< glm::vec< N, T, Q > > >", "structnb_1_1detail_1_1type__caster_3_01std_1_1vector_3_01glm_1_1vec_3_01_n_00_01_t_00_01_q_01_4_01_4_01_4.html", null ], + [ "unary_function", null, [ + [ "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< 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< 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..a2a42ece4 --- /dev/null +++ b/docs/html/impl_8h_source.html @@ -0,0 +1,329 @@ + + + + + + + +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, const glm::mat4x3 = glm::mat4x3(1));
+
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 inline void ForVert(int halfedge, std::function<void(int halfedge)> func) {
+
70 int current = halfedge;
+
71 do {
+
72 current = NextHalfedge(halfedge_[current].pairedHalfedge);
+
73 func(current);
+
74 } while (current != halfedge);
+
75 }
+
76
+
77 template <typename T>
+
78 void ForVert(int halfedge, std::function<T(int halfedge)> transform,
+
79 std::function<void(int halfedge, const T& here, const T& next)>
+
80 binaryOp) {
+
81 T here = transform(halfedge);
+
82 int current = halfedge;
+
83 do {
+
84 const int nextHalfedge = NextHalfedge(halfedge_[current].pairedHalfedge);
+
85 const T next = transform(nextHalfedge);
+
86 binaryOp(current, here, next);
+
87 here = next;
+
88 current = nextHalfedge;
+
89 } while (current != halfedge);
+
90 }
+
91
+
92 void CreateFaces(const std::vector<float>& propertyTolerance = {});
+
93 void RemoveUnreferencedVerts(Vec<glm::ivec3>& triVerts);
+
94 void InitializeOriginal();
+
95 void CreateHalfedges(const Vec<glm::ivec3>& triVerts);
+
96 void CalculateNormals();
+
97 void IncrementMeshIDs();
+
98
+
99 void Update();
+
100 void MarkFailure(Error status);
+
101 void Warp(std::function<void(glm::vec3&)> warpFunc);
+
102 void WarpBatch(std::function<void(VecView<glm::vec3>)> warpFunc);
+
103 Impl Transform(const glm::mat4x3& transform) const;
+
104 SparseIndices EdgeCollisions(const Impl& B, bool inverted = false) const;
+
105 SparseIndices VertexCollisionsZ(VecView<const glm::vec3> vertsIn,
+
106 bool inverted = false) const;
+
107 float MinGap(const Impl& other, float searchLength) const;
+
108
+
109 bool IsEmpty() const { return NumVert() == 0; }
+
110 int NumVert() const { return vertPos_.size(); }
+
111 int NumEdge() const { return halfedge_.size() / 2; }
+
112 int NumTri() const { return halfedge_.size() / 3; }
+
113 int NumProp() const { return meshRelation_.numProp; }
+
114 int NumPropVert() const {
+
115 return NumProp() == 0 ? NumVert()
+
116 : meshRelation_.properties.size() / NumProp();
+
117 }
+
118
+
119 // properties.cu
+
120 Properties GetProperties() const;
+
121 void CalculateCurvature(int gaussianIdx, int meanIdx);
+
122 void CalculateBBox();
+
123 bool IsFinite() const;
+
124 bool IsIndexInBounds(VecView<const glm::ivec3> triVerts) const;
+
125 void SetPrecision(float minPrecision = -1);
+
126 bool IsManifold() const;
+
127 bool Is2Manifold() const;
+
128 bool MatchesTriNormals() const;
+
129 int NumDegenerateTris() const;
+
130
+
131 // sort.cu
+
132 void Finish();
+
133 void SortVerts();
+
134 void ReindexVerts(const Vec<int>& vertNew2Old, int numOldVert);
+
135 void CompactProps();
+
136 void GetFaceBoxMorton(Vec<Box>& faceBox, Vec<uint32_t>& faceMorton) const;
+
137 void SortFaces(Vec<Box>& faceBox, Vec<uint32_t>& faceMorton);
+
138 void GatherFaces(const Vec<int>& faceNew2Old);
+
139 void GatherFaces(const Impl& old, const Vec<int>& faceNew2Old);
+
140
+
141 // face_op.cu
+
142 void Face2Tri(const Vec<int>& faceEdge, const Vec<TriRef>& halfedgeRef);
+
143 PolygonsIdx Face2Polygons(VecView<Halfedge>::IterC start,
+
144 VecView<Halfedge>::IterC end,
+
145 glm::mat3x2 projection) const;
+
146 CrossSection Slice(float height) const;
+
147 CrossSection Project() const;
+
148
+
149 // edge_op.cu
+
150 void SimplifyTopology();
+
151 void DedupeEdge(int edge);
+
152 void CollapseEdge(int edge, std::vector<int>& edges);
+
153 void RecursiveEdgeSwap(int edge, int& tag, std::vector<int>& visited,
+
154 std::vector<int>& edgeSwapStack,
+
155 std::vector<int>& edges);
+
156 void RemoveIfFolded(int edge);
+
157 void PairUp(int edge0, int edge1);
+
158 void UpdateVert(int vert, int startEdge, int endEdge);
+
159 void FormLoop(int current, int end);
+
160 void CollapseTri(const glm::ivec3& triEdge);
+
161 void SplitPinchedVerts();
+
162
+
163 // smoothing.cu
+
164 glm::vec3 GetNormal(int halfedge, int normalIdx) const;
+
165 std::vector<Smoothness> UpdateSharpenedEdges(
+
166 const std::vector<Smoothness>&) const;
+
167 Vec<bool> FlatFaces() const;
+
168 Vec<int> VertFlatFace(const Vec<bool>&) const;
+
169 std::vector<Smoothness> SharpenEdges(float minSharpAngle,
+
170 float minSmoothness) const;
+
171 void SetNormals(int normalIdx, float minSharpAngle);
+
172 void CreateTangents(int normalIdx);
+
173 void CreateTangents(std::vector<Smoothness>);
+
174 Vec<Barycentric> Subdivide(std::function<int(glm::vec3)>);
+
175 void Refine(std::function<int(glm::vec3)>);
+
176};
+
+
177} // namespace manifold
+
Definition collider.h:23
+
Definition vec.h:45
+
Definition meshIO.h:20
+
Definition public.h:171
+
Definition impl.h:30
+
bool IsIndexInBounds(VecView< const glm::ivec3 > triVerts) const
Definition properties.cpp:408
+
void IncrementMeshIDs()
Definition impl.cpp:847
+
bool IsManifold() const
Definition properties.cpp:274
+
void SetPrecision(float minPrecision=-1)
Definition impl.cpp:811
+
bool IsFinite() const
Definition properties.cpp:397
+
void SetNormals(int normalIdx, float minSharpAngle)
Definition smoothing.cpp:614
+
void CalculateBBox()
Definition properties.cpp:383
+
void SimplifyTopology()
Definition edge_op.cpp:143
+
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:341
+
void SortFaces(Vec< Box > &faceBox, Vec< uint32_t > &faceMorton)
Definition sort.cpp:395
+
int originalID
The originalID of this Manifold if it is an original; -1 otherwise.
Definition impl.h:38
+
void GatherFaces(const Vec< int > &faceNew2Old)
Definition sort.cpp:426
+
Vec< Barycentric > Subdivide(std::function< int(glm::vec3)>)
Definition smoothing.cpp:983
+
void CreateTangents(int normalIdx)
Definition smoothing.cpp:799
+
void CalculateNormals()
Definition impl.cpp:827
+
PolygonsIdx Face2Polygons(VecView< Halfedge >::IterC start, VecView< Halfedge >::IterC end, glm::mat3x2 projection) const
Definition face_op.cpp:203
+
void GetFaceBoxMorton(Vec< Box > &faceBox, Vec< uint32_t > &faceMorton) const
Definition sort.cpp:381
+
void Update()
Definition impl.cpp:711
+
void Face2Tri(const Vec< int > &faceEdge, const Vec< TriRef > &halfedgeRef)
Definition face_op.cpp:40
+
void CompactProps()
Definition sort.cpp:353
+
void Finish()
Definition sort.cpp:242
+
SparseIndices VertexCollisionsZ(VecView< const glm::vec3 > vertsIn, bool inverted=false) const
Definition impl.cpp:898
+
int NumDegenerateTris() const
Definition properties.cpp:311
+
SparseIndices EdgeCollisions(const Impl &B, bool inverted=false) const
Definition impl.cpp:869
+
void CreateHalfedges(const Vec< glm::ivec3 > &triVerts)
Definition impl.cpp:676
+ + +
Definition manifold.h:47
+
+
+ + + + diff --git a/docs/html/index.html b/docs/html/index.html new file mode 100644 index 000000000..6ecba309d --- /dev/null +++ b/docs/html/index.html @@ -0,0 +1,127 @@ + + + + + + + +Manifold: Python Bindings + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Python Bindings
+
+
+

+

+Autogenerated Doc-Strings

+

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

+

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

+

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

+
+

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

+

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

+

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

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

Alternateively you could generate stubs with roughly the same info

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

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

+
+
+
+ + + + diff --git a/docs/html/index.js b/docs/html/index.js new file mode 100644 index 000000000..baf35f784 --- /dev/null +++ b/docs/html/index.js @@ -0,0 +1,4 @@ +var index = +[ + [ "Autogenerated Doc-Strings", "index.html#autotoc_md1", null ] +]; \ No newline at end of file diff --git a/docs/html/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..549784ff2 --- /dev/null +++ b/docs/html/manifold_8h_source.html @@ -0,0 +1,382 @@ + + + + + + + +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#include "vec_view.h"
+
22
+
23namespace manifold {
+
24
+
32ExecutionParams& ManifoldParams();
+
33
+
34class CsgNode;
+
35class CsgLeafNode;
+
36
+
+
47struct MeshGL {
+
+
49 uint32_t NumVert() const {
+
50 if (vertProperties.size() / numProp >= std::numeric_limits<int>::max())
+
51 throw std::out_of_range("mesh too large");
+
52 return vertProperties.size() / numProp;
+
53 };
+
+
+
55 uint32_t NumTri() const {
+
56 if (vertProperties.size() / numProp >= std::numeric_limits<int>::max())
+
57 throw std::out_of_range("mesh too large");
+
58 return triVerts.size() / 3;
+
59 };
+
+
60
+
62 uint32_t numProp = 3;
+
66 std::vector<float> vertProperties;
+
69 std::vector<uint32_t> triVerts;
+
72 std::vector<uint32_t> mergeFromVert;
+
76 std::vector<uint32_t> mergeToVert;
+
81 std::vector<uint32_t> runIndex;
+
87 std::vector<uint32_t> runOriginalID;
+
92 std::vector<float> runTransform;
+
100 std::vector<uint32_t> faceID;
+
105 std::vector<float> halfedgeTangent;
+
110 float precision = 0;
+
111
+
112 MeshGL() = default;
+
113 MeshGL(const Mesh& mesh);
+
114
+
115 bool Merge();
+
116};
+
+
+
148class Manifold {
+
149 public:
+
154 Manifold();
+
155 ~Manifold();
+
156 Manifold(const Manifold& other);
+
157 Manifold& operator=(const Manifold& other);
+
158 Manifold(Manifold&&) noexcept;
+
159 Manifold& operator=(Manifold&&) noexcept;
+
160
+
161 Manifold(const MeshGL&, const std::vector<float>& propertyTolerance = {});
+
162 Manifold(const Mesh&);
+
163
+
164 static Manifold Smooth(const MeshGL&,
+
165 const std::vector<Smoothness>& sharpenedEdges = {});
+
166 static Manifold Smooth(const Mesh&,
+
167 const std::vector<Smoothness>& sharpenedEdges = {});
+
168 static Manifold Tetrahedron();
+
169 static Manifold Cube(glm::vec3 size = glm::vec3(1.0f), bool center = false);
+
170 static Manifold Cylinder(float height, float radiusLow,
+
171 float radiusHigh = -1.0f, int circularSegments = 0,
+
172 bool center = false);
+
173 static Manifold Sphere(float radius, int circularSegments = 0);
+
174 static Manifold Extrude(const CrossSection& crossSection, float height,
+
175 int nDivisions = 0, float twistDegrees = 0.0f,
+
176 glm::vec2 scaleTop = glm::vec2(1.0f));
+
177 static Manifold Revolve(const CrossSection& crossSection,
+
178 int circularSegments = 0,
+
179 float revolveDegrees = 360.0f);
+
181
+
186 static Manifold Compose(const std::vector<Manifold>&);
+
187 std::vector<Manifold> Decompose() const;
+
189
+
194 Mesh GetMesh() const;
+
195 MeshGL GetMeshGL(glm::ivec3 normalIdx = glm::ivec3(0)) const;
+
196 bool IsEmpty() const;
+
197 enum class Error {
+
198 NoError,
+
199 NonFiniteVertex,
+
200 NotManifold,
+
201 VertexOutOfBounds,
+
202 PropertiesWrongLength,
+
203 MissingPositionProperties,
+
204 MergeVectorsDifferentLengths,
+
205 MergeIndexOutOfBounds,
+
206 TransformWrongLength,
+
207 RunIndexWrongLength,
+
208 FaceIDWrongLength,
+
209 InvalidConstruction,
+
210 };
+
211 Error Status() const;
+
212 int NumVert() const;
+
213 int NumEdge() const;
+
214 int NumTri() const;
+
215 int NumProp() const;
+
216 int NumPropVert() const;
+
217 Box BoundingBox() const;
+
218 float Precision() const;
+
219 int Genus() const;
+ +
221 float MinGap(const Manifold& other, float searchLength) const;
+
223
+
229 int OriginalID() const;
+
230 Manifold AsOriginal() const;
+
231 static uint32_t ReserveIDs(uint32_t);
+
233
+
237 Manifold Translate(glm::vec3) const;
+
238 Manifold Scale(glm::vec3) const;
+
239 Manifold Rotate(float xDegrees, float yDegrees = 0.0f,
+
240 float zDegrees = 0.0f) const;
+
241 Manifold Transform(const glm::mat4x3&) const;
+
242 Manifold Mirror(glm::vec3) const;
+
243 Manifold Warp(std::function<void(glm::vec3&)>) const;
+
244 Manifold WarpBatch(std::function<void(VecView<glm::vec3>)>) const;
+ +
246 int, std::function<void(float*, glm::vec3, const float*)>) const;
+
247 Manifold CalculateCurvature(int gaussianIdx, int meanIdx) const;
+
248 Manifold CalculateNormals(int normalIdx, float minSharpAngle = 60) const;
+
249 Manifold SmoothByNormals(int normalIdx) const;
+
250 Manifold SmoothOut(float minSharpAngle = 60, float minSmoothness = 0) const;
+
251 Manifold Refine(int) const;
+
252 Manifold RefineToLength(float) const;
+
253 // Manifold RefineToPrecision(float);
+
255
+
260 Manifold Boolean(const Manifold& second, OpType op) const;
+
261 static Manifold BatchBoolean(const std::vector<Manifold>& manifolds,
+
262 OpType op);
+
263 // Boolean operation shorthand
+
264 Manifold operator+(const Manifold&) const; // Add (Union)
+ +
266 Manifold operator-(const Manifold&) const; // Subtract (Difference)
+ +
268 Manifold operator^(const Manifold&) const; // Intersect
+ +
270 std::pair<Manifold, Manifold> Split(const Manifold&) const;
+
271 std::pair<Manifold, Manifold> SplitByPlane(glm::vec3 normal,
+
272 float originOffset) const;
+
273 Manifold TrimByPlane(glm::vec3 normal, float originOffset) const;
+
275
+
279 CrossSection Slice(float height = 0) const;
+
280 CrossSection Project() const;
+
282
+
286 Manifold Hull() const;
+
287 static Manifold Hull(const std::vector<Manifold>& manifolds);
+
288 static Manifold Hull(const std::vector<glm::vec3>& pts);
+
290
+
295 bool MatchesTriNormals() const;
+
296 int NumDegenerateTris() const;
+
297 int NumOverlaps(const Manifold& second) const;
+
299
+
300 struct Impl;
+
301
+
302 private:
+
303 Manifold(std::shared_ptr<CsgNode> pNode_);
+
304 Manifold(std::shared_ptr<Impl> pImpl_);
+
305 static Manifold Invalid();
+
306 mutable std::shared_ptr<CsgNode> pNode_;
+
307
+
308 CsgLeafNode& GetCsgLeafNode() const;
+
309};
+
+
311} // namespace manifold
+
Definition cross_section.h:40
+
Definition csg_tree.h:41
+
Definition manifold.h:148
+
float Precision() const
Definition manifold.cpp:404
+
int NumOverlaps(const Manifold &second) const
Definition manifold.cpp:483
+
int NumEdge() const
Definition manifold.cpp:374
+
Manifold CalculateCurvature(int gaussianIdx, int meanIdx) const
Definition manifold.cpp:653
+
Manifold SetProperties(int, std::function< void(float *, glm::vec3, const float *)>) const
Definition manifold.cpp:597
+
static Manifold BatchBoolean(const std::vector< Manifold > &manifolds, OpType op)
Definition manifold.cpp:780
+
Manifold TrimByPlane(glm::vec3 normal, float originOffset) const
Definition manifold.cpp:879
+
static uint32_t ReserveIDs(uint32_t)
Definition manifold.cpp:455
+
static Manifold Sphere(float radius, int circularSegments=0)
Definition constructors.cpp:203
+
Box BoundingBox() const
Definition manifold.cpp:395
+
Error Status() const
Definition manifold.cpp:364
+
static Manifold Cube(glm::vec3 size=glm::vec3(1.0f), bool center=false)
Definition constructors.cpp:151
+
int NumProp() const
Definition manifold.cpp:382
+
float MinGap(const Manifold &other, float searchLength) const
Definition manifold.cpp:957
+
int NumTri() const
Definition manifold.cpp:378
+
int Genus() const
Definition manifold.cpp:413
+
Manifold RefineToLength(float) const
Definition manifold.cpp:750
+
Manifold & operator+=(const Manifold &)
Definition manifold.cpp:802
+
Manifold Rotate(float xDegrees, float yDegrees=0.0f, float zDegrees=0.0f) const
Definition manifold.cpp:525
+
MeshGL GetMeshGL(glm::ivec3 normalIdx=glm::ivec3(0)) const
Definition manifold.cpp:193
+
Manifold Refine(int) const
Definition manifold.cpp:733
+
std::pair< Manifold, Manifold > Split(const Manifold &) const
Definition manifold.cpp:844
+
bool MatchesTriNormals() const
Definition manifold.cpp:464
+
int OriginalID() const
Definition manifold.cpp:430
+
Manifold CalculateNormals(int normalIdx, float minSharpAngle=60) const
Definition manifold.cpp:674
+
Manifold Transform(const glm::mat4x3 &) const
Definition manifold.cpp:537
+
Mesh GetMesh() const
Definition manifold.cpp:158
+
Manifold WarpBatch(std::function< void(VecView< glm::vec3 >)>) const
Definition manifold.cpp:580
+
std::vector< Manifold > Decompose() const
Definition constructors.cpp:466
+
CrossSection Project() const
Definition manifold.cpp:897
+
int NumVert() const
Definition manifold.cpp:370
+
Manifold & operator^=(const Manifold &)
Definition manifold.cpp:832
+
Manifold SmoothOut(float minSharpAngle=60, float minSmoothness=0) const
Definition manifold.cpp:715
+
bool IsEmpty() const
Definition manifold.cpp:355
+
CrossSection Slice(float height=0) const
Definition manifold.cpp:889
+
Manifold Mirror(glm::vec3) const
Definition manifold.cpp:549
+
static Manifold Compose(const std::vector< Manifold > &)
Definition constructors.cpp:453
+
Manifold Boolean(const Manifold &second, OpType op) const
Definition manifold.cpp:772
+
Manifold AsOriginal() const
Definition manifold.cpp:440
+
Manifold Hull() const
Definition manifold.cpp:939
+
Manifold SmoothByNormals(int normalIdx) const
Definition manifold.cpp:690
+
int NumPropVert() const
Definition manifold.cpp:388
+
static Manifold Revolve(const CrossSection &crossSection, int circularSegments=0, float revolveDegrees=360.0f)
Definition constructors.cpp:325
+
Manifold Translate(glm::vec3) const
Definition manifold.cpp:499
+
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:421
+
static Manifold Cylinder(float height, float radiusLow, float radiusHigh=-1.0f, int circularSegments=0, bool center=false)
Definition constructors.cpp:174
+
Manifold operator^(const Manifold &) const
Definition manifold.cpp:825
+
Manifold()
Definition manifold.cpp:84
+
Manifold operator-(const Manifold &) const
Definition manifold.cpp:810
+
std::pair< Manifold, Manifold > SplitByPlane(glm::vec3 normal, float originOffset) const
Definition manifold.cpp:865
+
Manifold Scale(glm::vec3) const
Definition manifold.cpp:509
+
Manifold & operator-=(const Manifold &)
Definition manifold.cpp:817
+
Manifold Warp(std::function< void(glm::vec3 &)>) const
Definition manifold.cpp:567
+
Manifold operator+(const Manifold &) const
Definition manifold.cpp:795
+
static Manifold Tetrahedron()
Definition constructors.cpp:139
+
int NumDegenerateTris() const
Definition manifold.cpp:473
+
static Manifold Smooth(const MeshGL &, const std::vector< Smoothness > &sharpenedEdges={})
Definition constructors.cpp:81
+
Definition vec_view.h:27
+
Definition public.h:129
+
Definition public.h:167
+
OpType
Definition public.h:493
+
ExecutionParams & ManifoldParams()
Definition manifold.cpp:901
+
Definition meshIO.h:20
+
Definition public.h:171
+
Definition impl.h:30
+
Definition manifold.h:47
+
std::vector< uint32_t > runIndex
Definition manifold.h:81
+
bool Merge()
Definition sort.cpp:519
+
uint32_t NumVert() const
Number of property vertices.
Definition manifold.h:49
+
std::vector< float > runTransform
Definition manifold.h:92
+
uint32_t NumTri() const
Number of triangles.
Definition manifold.h:55
+
std::vector< float > halfedgeTangent
Definition manifold.h:105
+
std::vector< uint32_t > mergeFromVert
Definition manifold.h:72
+
std::vector< float > vertProperties
Definition manifold.h:66
+
std::vector< uint32_t > runOriginalID
Definition manifold.h:87
+
std::vector< uint32_t > faceID
Definition manifold.h:100
+
float precision
Definition manifold.h:110
+
uint32_t numProp
Number of properties per vertex, always >= 3.
Definition manifold.h:62
+
std::vector< uint32_t > mergeToVert
Definition manifold.h:76
+
std::vector< uint32_t > triVerts
Definition manifold.h:69
+
+
+ + + + diff --git a/docs/html/manifoldc_8h_source.html b/docs/html/manifoldc_8h_source.html new file mode 100644 index 000000000..c015fcdc0 --- /dev/null +++ b/docs/html/manifoldc_8h_source.html @@ -0,0 +1,562 @@ + + + + + + + +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// 3D to 2D
+
115
+
116ManifoldCrossSection *manifold_slice(void *mem, ManifoldManifold *m,
+
117 float height);
+
118ManifoldCrossSection *manifold_project(void *mem, ManifoldManifold *m);
+
119
+
120// Convex Hulls
+
121
+
122ManifoldManifold *manifold_hull(void *mem, ManifoldManifold *m);
+
123ManifoldManifold *manifold_batch_hull(void *mem, ManifoldManifoldVec *ms);
+
124ManifoldManifold *manifold_hull_pts(void *mem, ManifoldVec3 *ps, size_t length);
+
125
+
126// Manifold Transformations
+
127
+
128ManifoldManifold *manifold_translate(void *mem, ManifoldManifold *m, float x,
+
129 float y, float z);
+
130ManifoldManifold *manifold_rotate(void *mem, ManifoldManifold *m, float x,
+
131 float y, float z);
+
132ManifoldManifold *manifold_scale(void *mem, ManifoldManifold *m, float x,
+
133 float y, float z);
+
134ManifoldManifold *manifold_transform(void *mem, ManifoldManifold *m, float x1,
+
135 float y1, float z1, float x2, float y2,
+
136 float z2, float x3, float y3, float z3,
+
137 float x4, float y4, float z4);
+
138ManifoldManifold *manifold_mirror(void *mem, ManifoldManifold *m, float nx,
+
139 float ny, float nz);
+
140ManifoldManifold *manifold_warp(void *mem, ManifoldManifold *m,
+
141 ManifoldVec3 (*fun)(float, float, float));
+
142ManifoldManifold *manifold_smooth_by_normals(void *mem, ManifoldManifold *m,
+
143 int normalIdx);
+
144ManifoldManifold *manifold_smooth_out(void *mem, ManifoldManifold *m,
+
145 float minSharpAngle, float minSmoothness);
+
146ManifoldManifold *manifold_refine(void *mem, ManifoldManifold *m, int refine);
+
147ManifoldManifold *manifold_refine_to_length(void *mem, ManifoldManifold *m,
+
148 float length);
+
149
+
150// Manifold Shapes / Constructors
+
151
+
152ManifoldManifold *manifold_empty(void *mem);
+
153ManifoldManifold *manifold_copy(void *mem, ManifoldManifold *m);
+
154ManifoldManifold *manifold_tetrahedron(void *mem);
+
155ManifoldManifold *manifold_cube(void *mem, float x, float y, float z,
+
156 int center);
+
157ManifoldManifold *manifold_cylinder(void *mem, float height, float radius_low,
+
158 float radius_high, int circular_segments,
+
159 int center);
+
160ManifoldManifold *manifold_sphere(void *mem, float radius,
+
161 int circular_segments);
+
162ManifoldManifold *manifold_of_meshgl(void *mem, ManifoldMeshGL *mesh);
+
163ManifoldManifold *manifold_smooth(void *mem, ManifoldMeshGL *mesh,
+
164 int *half_edges, float *smoothness,
+
165 int n_idxs);
+
166ManifoldManifold *manifold_extrude(void *mem, ManifoldCrossSection *cs,
+
167 float height, int slices,
+
168 float twist_degrees, float scale_x,
+
169 float scale_y);
+
170ManifoldManifold *manifold_revolve(void *mem, ManifoldCrossSection *cs,
+
171 int circular_segments);
+
172ManifoldManifold *manifold_compose(void *mem, ManifoldManifoldVec *ms);
+
173ManifoldManifoldVec *manifold_decompose(void *mem, ManifoldManifold *m);
+
174ManifoldManifold *manifold_as_original(void *mem, ManifoldManifold *m);
+
175
+
176// Manifold Info
+
177
+
178int manifold_is_empty(ManifoldManifold *m);
+
179ManifoldError manifold_status(ManifoldManifold *m);
+
180int manifold_num_vert(ManifoldManifold *m);
+
181int manifold_num_edge(ManifoldManifold *m);
+
182int manifold_num_tri(ManifoldManifold *m);
+
183ManifoldBox *manifold_bounding_box(void *mem, ManifoldManifold *m);
+
184float manifold_precision(ManifoldManifold *m);
+
185int manifold_genus(ManifoldManifold *m);
+
186ManifoldProperties manifold_get_properties(ManifoldManifold *m);
+
187int manifold_get_circular_segments(float radius);
+
188int manifold_original_id(ManifoldManifold *m);
+
189uint32_t manifold_reserve_ids(uint32_t n);
+
190ManifoldManifold *manifold_set_properties(
+
191 void *mem, ManifoldManifold *m, int num_prop,
+
192 void (*fun)(float *new_prop, ManifoldVec3 position, const float *old_prop));
+
193ManifoldManifold *manifold_calculate_curvature(void *mem, ManifoldManifold *m,
+
194 int gaussian_idx, int mean_idx);
+
195float manifold_min_gap(ManifoldManifold *m, ManifoldManifold *other,
+
196 float searchLength);
+
197ManifoldManifold *manifold_calculate_normals(void *mem, ManifoldManifold *m,
+
198 int normal_idx,
+
199 int min_sharp_angle);
+
200
+
201// CrossSection Shapes/Constructors
+
202
+
203ManifoldCrossSection *manifold_cross_section_empty(void *mem);
+
204ManifoldCrossSection *manifold_cross_section_copy(void *mem,
+
205 ManifoldCrossSection *cs);
+
206ManifoldCrossSection *manifold_cross_section_of_simple_polygon(
+
207 void *mem, ManifoldSimplePolygon *p, ManifoldFillRule fr);
+
208ManifoldCrossSection *manifold_cross_section_of_polygons(void *mem,
+
209 ManifoldPolygons *p,
+
210 ManifoldFillRule fr);
+
211ManifoldCrossSection *manifold_cross_section_square(void *mem, float x, float y,
+
212 int center);
+
213ManifoldCrossSection *manifold_cross_section_circle(void *mem, float radius,
+
214 int circular_segments);
+
215ManifoldCrossSection *manifold_cross_section_compose(
+
216 void *mem, ManifoldCrossSectionVec *csv);
+
217ManifoldCrossSectionVec *manifold_cross_section_decompose(
+
218 void *mem, ManifoldCrossSection *cs);
+
219
+
220// CrossSection Vectors
+
221
+
222ManifoldCrossSectionVec *manifold_cross_section_empty_vec(void *mem);
+
223ManifoldCrossSectionVec *manifold_cross_section_vec(void *mem, size_t sz);
+
224void manifold_cross_section_vec_reserve(ManifoldCrossSectionVec *csv,
+
225 size_t sz);
+
226size_t manifold_cross_section_vec_length(ManifoldCrossSectionVec *csv);
+
227ManifoldCrossSection *manifold_cross_section_vec_get(
+
228 void *mem, ManifoldCrossSectionVec *csv, int idx);
+
229void manifold_cross_section_vec_set(ManifoldCrossSectionVec *csv, int idx,
+
230 ManifoldCrossSection *cs);
+
231void manifold_cross_section_vec_push_back(ManifoldCrossSectionVec *csv,
+
232 ManifoldCrossSection *cs);
+
233
+
234// CrossSection Booleans
+
235
+
236ManifoldCrossSection *manifold_cross_section_boolean(void *mem,
+
237 ManifoldCrossSection *a,
+
238 ManifoldCrossSection *b,
+
239 ManifoldOpType op);
+
240ManifoldCrossSection *manifold_cross_section_batch_boolean(
+
241 void *mem, ManifoldCrossSectionVec *csv, ManifoldOpType op);
+
242ManifoldCrossSection *manifold_cross_section_union(void *mem,
+
243 ManifoldCrossSection *a,
+
244 ManifoldCrossSection *b);
+
245ManifoldCrossSection *manifold_cross_section_difference(
+
246 void *mem, ManifoldCrossSection *a, ManifoldCrossSection *b);
+
247ManifoldCrossSection *manifold_cross_section_intersection(
+
248 void *mem, ManifoldCrossSection *a, ManifoldCrossSection *b);
+
249
+
250// CrossSection Convex Hulls
+
251
+
252ManifoldCrossSection *manifold_cross_section_hull(void *mem,
+
253 ManifoldCrossSection *cs);
+
254ManifoldCrossSection *manifold_cross_section_batch_hull(
+
255 void *mem, ManifoldCrossSectionVec *css);
+
256ManifoldCrossSection *manifold_cross_section_hull_simple_polygon(
+
257 void *mem, ManifoldSimplePolygon *ps);
+
258ManifoldCrossSection *manifold_cross_section_hull_polygons(
+
259 void *mem, ManifoldPolygons *ps);
+
260
+
261// CrossSection Transformation
+
262
+
263ManifoldCrossSection *manifold_cross_section_translate(void *mem,
+
264 ManifoldCrossSection *cs,
+
265 float x, float y);
+
266ManifoldCrossSection *manifold_cross_section_rotate(void *mem,
+
267 ManifoldCrossSection *cs,
+
268 float deg);
+
269ManifoldCrossSection *manifold_cross_section_scale(void *mem,
+
270 ManifoldCrossSection *cs,
+
271 float x, float y);
+
272ManifoldCrossSection *manifold_cross_section_mirror(void *mem,
+
273 ManifoldCrossSection *cs,
+
274 float ax_x, float ax_y);
+
275ManifoldCrossSection *manifold_cross_section_transform(void *mem,
+
276 ManifoldCrossSection *cs,
+
277 float x1, float y1,
+
278 float x2, float y2,
+
279 float x3, float y3);
+
280ManifoldCrossSection *manifold_cross_section_warp(
+
281 void *mem, ManifoldCrossSection *cs, ManifoldVec2 (*fun)(float, float));
+
282ManifoldCrossSection *manifold_cross_section_simplify(void *mem,
+
283 ManifoldCrossSection *cs,
+
284 double epsilon);
+
285ManifoldCrossSection *manifold_cross_section_offset(
+
286 void *mem, ManifoldCrossSection *cs, double delta, ManifoldJoinType jt,
+
287 double miter_limit, int circular_segments);
+
288
+
289// CrossSection Info
+
290
+
291double manifold_cross_section_area(ManifoldCrossSection *cs);
+
292int manifold_cross_section_num_vert(ManifoldCrossSection *cs);
+
293int manifold_cross_section_num_contour(ManifoldCrossSection *cs);
+
294int manifold_cross_section_is_empty(ManifoldCrossSection *cs);
+
295ManifoldRect *manifold_cross_section_bounds(void *mem,
+
296 ManifoldCrossSection *cs);
+
297ManifoldPolygons *manifold_cross_section_to_polygons(void *mem,
+
298 ManifoldCrossSection *cs);
+
299
+
300// Rectangle
+
301
+
302ManifoldRect *manifold_rect(void *mem, float x1, float y1, float x2, float y2);
+
303ManifoldVec2 manifold_rect_min(ManifoldRect *r);
+
304ManifoldVec2 manifold_rect_max(ManifoldRect *r);
+
305ManifoldVec2 manifold_rect_dimensions(ManifoldRect *r);
+
306ManifoldVec2 manifold_rect_center(ManifoldRect *r);
+
307float manifold_rect_scale(ManifoldRect *r);
+
308int manifold_rect_contains_pt(ManifoldRect *r, float x, float y);
+
309int manifold_rect_contains_rect(ManifoldRect *a, ManifoldRect *b);
+
310void manifold_rect_include_pt(ManifoldRect *r, float x, float y);
+
311ManifoldRect *manifold_rect_union(void *mem, ManifoldRect *a, ManifoldRect *b);
+
312ManifoldRect *manifold_rect_transform(void *mem, ManifoldRect *r, float x1,
+
313 float y1, float x2, float y2, float x3,
+
314 float y3);
+
315ManifoldRect *manifold_rect_translate(void *mem, ManifoldRect *r, float x,
+
316 float y);
+
317ManifoldRect *manifold_rect_mul(void *mem, ManifoldRect *r, float x, float y);
+
318int manifold_rect_does_overlap_rect(ManifoldRect *a, ManifoldRect *r);
+
319int manifold_rect_is_empty(ManifoldRect *r);
+
320int manifold_rect_is_finite(ManifoldRect *r);
+
321
+
322// Bounding Box
+
323
+
324ManifoldBox *manifold_box(void *mem, float x1, float y1, float z1, float x2,
+
325 float y2, float z2);
+
326ManifoldVec3 manifold_box_min(ManifoldBox *b);
+
327ManifoldVec3 manifold_box_max(ManifoldBox *b);
+
328ManifoldVec3 manifold_box_dimensions(ManifoldBox *b);
+
329ManifoldVec3 manifold_box_center(ManifoldBox *b);
+
330float manifold_box_scale(ManifoldBox *b);
+
331int manifold_box_contains_pt(ManifoldBox *b, float x, float y, float z);
+
332int manifold_box_contains_box(ManifoldBox *a, ManifoldBox *b);
+
333void manifold_box_include_pt(ManifoldBox *b, float x, float y, float z);
+
334ManifoldBox *manifold_box_union(void *mem, ManifoldBox *a, ManifoldBox *b);
+
335ManifoldBox *manifold_box_transform(void *mem, ManifoldBox *b, float x1,
+
336 float y1, float z1, float x2, float y2,
+
337 float z2, float x3, float y3, float z3,
+
338 float x4, float y4, float z4);
+
339ManifoldBox *manifold_box_translate(void *mem, ManifoldBox *b, float x, float y,
+
340 float z);
+
341ManifoldBox *manifold_box_mul(void *mem, ManifoldBox *b, float x, float y,
+
342 float z);
+
343int manifold_box_does_overlap_pt(ManifoldBox *b, float x, float y, float z);
+
344int manifold_box_does_overlap_box(ManifoldBox *a, ManifoldBox *b);
+
345int manifold_box_is_finite(ManifoldBox *b);
+
346
+
347// Static Quality Globals
+
348
+
349void manifold_set_min_circular_angle(float degrees);
+
350void manifold_set_min_circular_edge_length(float length);
+
351void manifold_set_circular_segments(int number);
+
352
+
353// Manifold Mesh Extraction
+
354
+
355int manifold_meshgl_num_prop(ManifoldMeshGL *m);
+
356int manifold_meshgl_num_vert(ManifoldMeshGL *m);
+
357int manifold_meshgl_num_tri(ManifoldMeshGL *m);
+
358size_t manifold_meshgl_vert_properties_length(ManifoldMeshGL *m);
+
359size_t manifold_meshgl_tri_length(ManifoldMeshGL *m);
+
360size_t manifold_meshgl_merge_length(ManifoldMeshGL *m);
+
361size_t manifold_meshgl_run_index_length(ManifoldMeshGL *m);
+
362size_t manifold_meshgl_run_original_id_length(ManifoldMeshGL *m);
+
363size_t manifold_meshgl_run_transform_length(ManifoldMeshGL *m);
+
364size_t manifold_meshgl_face_id_length(ManifoldMeshGL *m);
+
365size_t manifold_meshgl_tangent_length(ManifoldMeshGL *m);
+
366float *manifold_meshgl_vert_properties(void *mem, ManifoldMeshGL *m);
+
367uint32_t *manifold_meshgl_tri_verts(void *mem, ManifoldMeshGL *m);
+
368uint32_t *manifold_meshgl_merge_from_vert(void *mem, ManifoldMeshGL *m);
+
369uint32_t *manifold_meshgl_merge_to_vert(void *mem, ManifoldMeshGL *m);
+
370uint32_t *manifold_meshgl_run_index(void *mem, ManifoldMeshGL *m);
+
371uint32_t *manifold_meshgl_run_original_id(void *mem, ManifoldMeshGL *m);
+
372float *manifold_meshgl_run_transform(void *mem, ManifoldMeshGL *m);
+
373uint32_t *manifold_meshgl_face_id(void *mem, ManifoldMeshGL *m);
+
374float *manifold_meshgl_halfedge_tangent(void *mem, ManifoldMeshGL *m);
+
375
+
376// memory size
+
377
+
378size_t manifold_manifold_size();
+
379size_t manifold_manifold_vec_size();
+
380size_t manifold_cross_section_size();
+
381size_t manifold_cross_section_vec_size();
+
382size_t manifold_simple_polygon_size();
+
383size_t manifold_polygons_size();
+
384size_t manifold_manifold_pair_size();
+
385size_t manifold_meshgl_size();
+
386size_t manifold_box_size();
+
387size_t manifold_rect_size();
+
388size_t manifold_curvature_size();
+
389
+
390// destruction
+
391
+
392void manifold_destruct_manifold(ManifoldManifold *m);
+
393void manifold_destruct_manifold_vec(ManifoldManifoldVec *ms);
+
394void manifold_destruct_cross_section(ManifoldCrossSection *m);
+
395void manifold_destruct_cross_section_vec(ManifoldCrossSectionVec *csv);
+
396void manifold_destruct_simple_polygon(ManifoldSimplePolygon *p);
+
397void manifold_destruct_polygons(ManifoldPolygons *p);
+
398void manifold_destruct_meshgl(ManifoldMeshGL *m);
+
399void manifold_destruct_box(ManifoldBox *b);
+
400void manifold_destruct_rect(ManifoldRect *b);
+
401
+
402// pointer free + destruction
+
403
+
404void manifold_delete_manifold(ManifoldManifold *m);
+
405void manifold_delete_manifold_vec(ManifoldManifoldVec *ms);
+
406void manifold_delete_cross_section(ManifoldCrossSection *cs);
+
407void manifold_delete_cross_section_vec(ManifoldCrossSectionVec *csv);
+
408void manifold_delete_simple_polygon(ManifoldSimplePolygon *p);
+
409void manifold_delete_polygons(ManifoldPolygons *p);
+
410void manifold_delete_meshgl(ManifoldMeshGL *m);
+
411void manifold_delete_box(ManifoldBox *b);
+
412void manifold_delete_rect(ManifoldRect *b);
+
413
+
414// MeshIO / Export
+
415
+
416#ifdef MANIFOLD_EXPORT
+
417ManifoldMaterial *manifold_material(void *mem);
+
418void manifold_material_set_roughness(ManifoldMaterial *mat, float roughness);
+
419void manifold_material_set_metalness(ManifoldMaterial *mat, float metalness);
+
420void manifold_material_set_color(ManifoldMaterial *mat, ManifoldVec4 color);
+
421void manifold_material_set_vert_color(ManifoldMaterial *mat,
+
422 ManifoldVec4 *vert_color, size_t n_vert);
+
423ManifoldExportOptions *manifold_export_options(void *mem);
+
424void manifold_export_options_set_faceted(ManifoldExportOptions *options,
+
425 int faceted);
+
426void manifold_export_options_set_material(ManifoldExportOptions *options,
+
427 ManifoldMaterial *mat);
+
428void manifold_export_meshgl(const char *filename, ManifoldMeshGL *mesh,
+
429 ManifoldExportOptions *options);
+
430ManifoldMeshGL *manifold_import_meshgl(void *mem, const char *filename,
+
431 int force_cleanup);
+
432
+
433size_t manifold_material_size();
+
434size_t manifold_export_options_size();
+
435
+
436void manifold_destruct_material(ManifoldMaterial *m);
+
437void manifold_destruct_export_options(ManifoldExportOptions *options);
+
438
+
439void manifold_delete_material(ManifoldMaterial *m);
+
440void manifold_delete_export_options(ManifoldExportOptions *options);
+
441#endif
+
442
+
443#ifdef __cplusplus
+
444}
+
445#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..50665553e --- /dev/null +++ b/docs/html/md__c_o_n_t_r_i_b_u_t_i_n_g.html @@ -0,0 +1,123 @@ + + + + + + + +Manifold: How to Contribute + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
How to Contribute
+
+
+

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

+

+Contributor License Agreement

+

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

+

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

+

+Code Reviews

+

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

+

+Community Guidelines

+

This project follows Google's Open Source Community Guidelines.

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

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

    +
  1. Verify our three.js example is functional.
  2. +
+
    +
  1. Verify our model-viewer example is functional - select Union and Intersection.
  2. +
+
    +
  1. Verify make-manifold is functional. Try dropping DragonAttenuation.glb in and verify you can select "View Manifold GLB" and that the dragon is still present while the backdrop is removed. Download the GLB.
  2. +
+
    +
  1. Make a new branch called the version, e.g. v2.3.0.
  2. +
+
    +
  1. Use VSCode to search and replace the old version with the new - so far in test-cmake.sh, flake.nix, pyproject.toml, and package.json.
  2. +
+
    +
  1. Also update CMakeLists.txt version by searching for "set(MANIFOLD_VERSION_".
  2. +
+
    +
  1. Commit, push, open a PR, verify tests pass, merge.
  2. +
+
    +
  1. On Github, draft a new release, make a new tag with the version number, add release notes, and publish.
  2. +
+
    +
  1. Check the Actions and verify that both PyPI and npm publishing actions ran successfully.
  2. +
+
    +
  1. Verify the npm package looks good - unpacked size should be close to 1MB.
  2. +
+
    +
  1. Verify PyPI package looks good - a bunch of built distributions ranging from ~600kB to ~1.1MB.
  2. +
+
+
+
+ + + + diff --git a/docs/html/mesh__fixes_8h_source.html b/docs/html/mesh__fixes_8h_source.html new file mode 100644 index 000000000..7d9116b25 --- /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_view.h:27
+
Definition meshIO.h:20
+
Definition shared.h:149
+
+
+ + + + 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..4b91d5574 --- /dev/null +++ b/docs/html/mesh_i_o_8h_source.html @@ -0,0 +1,174 @@ + + + + + + + +Manifold: meshIO.h Source File + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
meshIO.h
+
+
+
1// Copyright 2021 The Manifold Authors.
+
2//
+
3// Licensed under the Apache License, Version 2.0 (the "License");
+
4// you may not use this file except in compliance with the License.
+
5// You may obtain a copy of the License at
+
6//
+
7// http://www.apache.org/licenses/LICENSE-2.0
+
8//
+
9// Unless required by applicable law or agreed to in writing, software
+
10// distributed under the License is distributed on an "AS IS" BASIS,
+
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+
12// See the License for the specific language governing permissions and
+
13// limitations under the License.
+
14
+
15#pragma once
+
16#include <string>
+
17
+
18#include "manifold.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/minus.svg b/docs/html/minus.svg new file mode 100644 index 000000000..f70d0c1a1 --- /dev/null +++ b/docs/html/minus.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/docs/html/minusd.svg b/docs/html/minusd.svg new file mode 100644 index 000000000..5f8e87962 --- /dev/null +++ b/docs/html/minusd.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/docs/html/namespacebricks.html b/docs/html/namespacebricks.html new file mode 100644 index 000000000..aa650e8f9 --- /dev/null +++ b/docs/html/namespacebricks.html @@ -0,0 +1,171 @@ + + + + + + + +Manifold: bricks Namespace Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
bricks Namespace Reference
+
+
+ + + + + + + + + + + + + + + + +

+Functions

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

+Variables

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

Detailed Description

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

+Functions

run (n=5, overlap=True)
 
+

Detailed Description

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

+Functions

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

Detailed Description

+
 Copyright 2023 The Manifold Authors.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+      https://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ + + + diff --git a/docs/html/namespacemanifold.html b/docs/html/namespacemanifold.html new file mode 100644 index 000000000..902daa0e9 --- /dev/null +++ b/docs/html/namespacemanifold.html @@ -0,0 +1,532 @@ + + + + + + + +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  SVDSet
 
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.
 
Mesh LevelSet (std::function< float(glm::vec3)> sdf, Box bounds, float edgeLength, float level=0, bool canParallel=true)
 
+constexpr ExecutionPolicy autoPolicy (size_t 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::mat3 &mat)
 
+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)
 
SVDSet SVD (glm::mat3 A)
 
float SpectralNorm (glm::mat3 A)
 
void EdgeEdgeDist (glm::vec3 &x, glm::vec3 &y, const glm::vec3 &p, const glm::vec3 &a, const glm::vec3 &q, const glm::vec3 &b)
 
float DistanceTriangleTriangleSquared (const std::array< glm::vec3, 3 > &p, const std::array< glm::vec3, 3 > &q)
 
+template<typename... Iters>
thrust::zip_iterator< thrust::tuple< Iters... > > zip (Iters... iters)
 
+template<typename A , typename B >
thrust::permutation_iterator< A, Bperm (A a, B b)
 
+template<typename T >
thrust::counting_iterator< TcountAt (T i)
 
+int Next3 (int i)
 
+int Prev3 (int i)
 
+template<typename T >
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.
 
+ExecutionParamsPolygonParams ()
 
+

Detailed Description

+

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

+

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

+

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

+

Function Documentation

+ +

◆ EdgeEdgeDist()

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

Returns the distance between two line segments.

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

◆ DistanceTriangleTriangleSquared()

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

Returns the minimum squared distance between two triangles.

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

+Variables

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

Detailed Description

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

Variable Documentation

+ +

◆ meshOut

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

+Functions

run ()
 
+

Detailed Description

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

+Functions

run ()
 
+

Detailed Description

+
 Copyright 2022 The Manifold Authors.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+      https://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ + + + diff --git a/docs/html/nav_f.png b/docs/html/nav_f.png new file mode 100644 index 000000000..72a58a529 Binary files /dev/null and b/docs/html/nav_f.png differ diff --git a/docs/html/nav_fd.png b/docs/html/nav_fd.png new file mode 100644 index 000000000..032fbdd4c Binary files /dev/null and b/docs/html/nav_fd.png differ diff --git a/docs/html/nav_g.png b/docs/html/nav_g.png new file mode 100644 index 000000000..2093a237a Binary files /dev/null and b/docs/html/nav_g.png differ diff --git a/docs/html/nav_h.png b/docs/html/nav_h.png new file mode 100644 index 000000000..33389b101 Binary files /dev/null and b/docs/html/nav_h.png differ diff --git a/docs/html/nav_hd.png b/docs/html/nav_hd.png new file mode 100644 index 000000000..de80f18ad Binary files /dev/null and b/docs/html/nav_hd.png differ diff --git a/docs/html/navtree.css b/docs/html/navtree.css new file mode 100644 index 000000000..69211d4a7 --- /dev/null +++ b/docs/html/navtree.css @@ -0,0 +1,149 @@ +#nav-tree .children_ul { + margin:0; + padding:4px; +} + +#nav-tree ul { + list-style:none outside none; + margin:0px; + padding:0px; +} + +#nav-tree li { + white-space:nowrap; + margin:0px; + padding:0px; +} + +#nav-tree .plus { + margin:0px; +} + +#nav-tree .selected { + background-image: url('tab_a.png'); + background-repeat:repeat-x; + color: var(--nav-text-active-color); + text-shadow: var(--nav-text-active-shadow); +} + +#nav-tree .selected .arrow { + color: var(--nav-arrow-selected-color); + text-shadow: none; +} + +#nav-tree img { + margin:0px; + padding:0px; + border:0px; + vertical-align: middle; +} + +#nav-tree a { + text-decoration:none; + padding:0px; + margin:0px; +} + +#nav-tree .label { + margin:0px; + padding:0px; + font: 12px var(--font-family-nav); +} + +#nav-tree .label a { + padding:2px; +} + +#nav-tree .selected a { + text-decoration:none; + color:var(--nav-text-active-color); +} + +#nav-tree .children_ul { + margin:0px; + padding:0px; +} + +#nav-tree .item { + margin:0px; + padding:0px; +} + +#nav-tree { + padding: 0px 0px; + font-size:14px; + overflow:auto; +} + +#doc-content { + overflow:auto; + display:block; + padding:0px; + margin:0px; + -webkit-overflow-scrolling : touch; /* iOS 5+ */ +} + +#side-nav { + padding:0 6px 0 0; + margin: 0px; + display:block; + position: absolute; + left: 0px; + width: $width; + overflow : hidden; +} + +.ui-resizable .ui-resizable-handle { + display:block; +} + +.ui-resizable-e { + background-image:var(--nav-splitbar-image); + background-size:100%; + background-repeat:repeat-y; + background-attachment: scroll; + cursor:ew-resize; + height:100%; + right:0; + top:0; + width:6px; +} + +.ui-resizable-handle { + display:none; + font-size:0.1px; + position:absolute; + z-index:1; +} + +#nav-tree-contents { + margin: 6px 0px 0px 0px; +} + +#nav-tree { + background-repeat:repeat-x; + background-color: var(--nav-background-color); + -webkit-overflow-scrolling : touch; /* iOS 5+ */ +} + +#nav-sync { + position:absolute; + top:5px; + right:24px; + z-index:0; +} + +#nav-sync img { + opacity:0.3; +} + +#nav-sync img:hover { + opacity:0.9; +} + +@media print +{ + #nav-tree { display: none; } + div.ui-resizable-handle { display: none; position: relative; } +} + diff --git a/docs/html/navtree.js b/docs/html/navtree.js new file mode 100644 index 000000000..93dd3d462 --- /dev/null +++ b/docs/html/navtree.js @@ -0,0 +1,559 @@ +/* + @licstart The following is the entire license notice for the JavaScript code in this file. + + The MIT License (MIT) + + Copyright (C) 1997-2020 by Dimitri van Heesch + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software + and associated documentation files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, publish, distribute, + sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or + substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + @licend The above is the entire license notice for the JavaScript code in this file + */ +var navTreeSubIndices = new Array(); +var arrowDown = '▼'; +var arrowRight = '►'; + +function getData(varName) +{ + var i = varName.lastIndexOf('/'); + var n = i>=0 ? varName.substring(i+1) : varName; + return eval(n.replace(/\-/g,'_')); +} + +function stripPath(uri) +{ + return uri.substring(uri.lastIndexOf('/')+1); +} + +function stripPath2(uri) +{ + var i = uri.lastIndexOf('/'); + var s = uri.substring(i+1); + var m = uri.substring(0,i+1).match(/\/d\w\/d\w\w\/$/); + return m ? uri.substring(i-6) : s; +} + +function hashValue() +{ + return $(location).attr('hash').substring(1).replace(/[^\w\-]/g,''); +} + +function hashUrl() +{ + return '#'+hashValue(); +} + +function pathName() +{ + return $(location).attr('pathname').replace(/[^-A-Za-z0-9+&@#/%?=~_|!:,.;\(\)]/g, ''); +} + +function localStorageSupported() +{ + try { + return 'localStorage' in window && window['localStorage'] !== null && window.localStorage.getItem; + } + catch(e) { + return false; + } +} + +function storeLink(link) +{ + if (!$("#nav-sync").hasClass('sync') && localStorageSupported()) { + window.localStorage.setItem('navpath',link); + } +} + +function deleteLink() +{ + if (localStorageSupported()) { + window.localStorage.setItem('navpath',''); + } +} + +function cachedLink() +{ + if (localStorageSupported()) { + return window.localStorage.getItem('navpath'); + } else { + return ''; + } +} + +function getScript(scriptName,func) +{ + var head = document.getElementsByTagName("head")[0]; + var script = document.createElement('script'); + script.id = scriptName; + script.type = 'text/javascript'; + script.onload = func; + script.src = scriptName+'.js'; + head.appendChild(script); +} + +function createIndent(o,domNode,node,level) +{ + var level=-1; + var n = node; + while (n.parentNode) { level++; n=n.parentNode; } + if (node.childrenData) { + var imgNode = document.createElement("span"); + imgNode.className = 'arrow'; + imgNode.style.paddingLeft=(16*level).toString()+'px'; + imgNode.innerHTML=arrowRight; + node.plus_img = imgNode; + node.expandToggle = document.createElement("a"); + node.expandToggle.href = "javascript:void(0)"; + node.expandToggle.onclick = function() { + if (node.expanded) { + $(node.getChildrenUL()).slideUp("fast"); + node.plus_img.innerHTML=arrowRight; + node.expanded = false; + } else { + expandNode(o, node, false, true); + } + } + node.expandToggle.appendChild(imgNode); + domNode.appendChild(node.expandToggle); + } else { + var span = document.createElement("span"); + span.className = 'arrow'; + span.style.width = 16*(level+1)+'px'; + span.innerHTML = ' '; + domNode.appendChild(span); + } +} + +var animationInProgress = false; + +function gotoAnchor(anchor,aname,updateLocation) +{ + var pos, docContent = $('#doc-content'); + var ancParent = $(anchor.parent()); + if (ancParent.hasClass('memItemLeft') || + ancParent.hasClass('memtitle') || + ancParent.hasClass('fieldname') || + ancParent.hasClass('fieldtype') || + ancParent.is(':header')) + { + pos = ancParent.position().top; + } else if (anchor.position()) { + pos = anchor.position().top; + } + if (pos) { + var dist = Math.abs(Math.min( + pos-docContent.offset().top, + docContent[0].scrollHeight- + docContent.height()-docContent.scrollTop())); + animationInProgress=true; + docContent.animate({ + scrollTop: pos + docContent.scrollTop() - docContent.offset().top + },Math.max(50,Math.min(500,dist)),function(){ + if (updateLocation) window.location.href=aname; + animationInProgress=false; + }); + } +} + +function newNode(o, po, text, link, childrenData, lastNode) +{ + var node = new Object(); + node.children = Array(); + node.childrenData = childrenData; + node.depth = po.depth + 1; + node.relpath = po.relpath; + node.isLast = lastNode; + + node.li = document.createElement("li"); + po.getChildrenUL().appendChild(node.li); + node.parentNode = po; + + node.itemDiv = document.createElement("div"); + node.itemDiv.className = "item"; + + node.labelSpan = document.createElement("span"); + node.labelSpan.className = "label"; + + createIndent(o,node.itemDiv,node,0); + node.itemDiv.appendChild(node.labelSpan); + node.li.appendChild(node.itemDiv); + + var a = document.createElement("a"); + node.labelSpan.appendChild(a); + node.label = document.createTextNode(text); + node.expanded = false; + a.appendChild(node.label); + if (link) { + var url; + if (link.substring(0,1)=='^') { + url = link.substring(1); + link = url; + } else { + url = node.relpath+link; + } + a.className = stripPath(link.replace('#',':')); + if (link.indexOf('#')!=-1) { + var aname = '#'+link.split('#')[1]; + var srcPage = stripPath(pathName()); + var targetPage = stripPath(link.split('#')[0]); + a.href = srcPage!=targetPage ? url : "javascript:void(0)"; + a.onclick = function(){ + storeLink(link); + if (!$(a).parent().parent().hasClass('selected')) + { + $('.item').removeClass('selected'); + $('.item').removeAttr('id'); + $(a).parent().parent().addClass('selected'); + $(a).parent().parent().attr('id','selected'); + } + var anchor = $(aname); + gotoAnchor(anchor,aname,true); + }; + } else { + a.href = url; + a.onclick = function() { storeLink(link); } + } + } else { + if (childrenData != null) + { + a.className = "nolink"; + a.href = "javascript:void(0)"; + a.onclick = node.expandToggle.onclick; + } + } + + node.childrenUL = null; + node.getChildrenUL = function() { + if (!node.childrenUL) { + node.childrenUL = document.createElement("ul"); + node.childrenUL.className = "children_ul"; + node.childrenUL.style.display = "none"; + node.li.appendChild(node.childrenUL); + } + return node.childrenUL; + }; + + return node; +} + +function showRoot() +{ + var headerHeight = $("#top").height(); + var footerHeight = $("#nav-path").height(); + var windowHeight = $(window).height() - headerHeight - footerHeight; + (function (){ // retry until we can scroll to the selected item + try { + var navtree=$('#nav-tree'); + navtree.scrollTo('#selected',100,{offset:-windowHeight/2}); + } catch (err) { + setTimeout(arguments.callee, 0); + } + })(); +} + +function expandNode(o, node, imm, setFocus) +{ + if (node.childrenData && !node.expanded) { + if (typeof(node.childrenData)==='string') { + var varName = node.childrenData; + getScript(node.relpath+varName,function(){ + node.childrenData = getData(varName); + expandNode(o, node, imm, setFocus); + }); + } else { + if (!node.childrenVisited) { + getNode(o, node); + } + $(node.getChildrenUL()).slideDown("fast"); + node.plus_img.innerHTML = arrowDown; + node.expanded = true; + if (setFocus) { + $(node.expandToggle).focus(); + } + } + } +} + +function glowEffect(n,duration) +{ + n.addClass('glow').delay(duration).queue(function(next){ + $(this).removeClass('glow');next(); + }); +} + +function highlightAnchor() +{ + var aname = hashUrl(); + var anchor = $(aname); + if (anchor.parent().attr('class')=='memItemLeft'){ + var rows = $('.memberdecls tr[class$="'+hashValue()+'"]'); + glowEffect(rows.children(),300); // member without details + } else if (anchor.parent().attr('class')=='fieldname'){ + glowEffect(anchor.parent().parent(),1000); // enum value + } else if (anchor.parent().attr('class')=='fieldtype'){ + glowEffect(anchor.parent().parent(),1000); // struct field + } else if (anchor.parent().is(":header")) { + glowEffect(anchor.parent(),1000); // section header + } else { + glowEffect(anchor.next(),1000); // normal member + } +} + +function selectAndHighlight(hash,n) +{ + var a; + if (hash) { + var link=stripPath(pathName())+':'+hash.substring(1); + a=$('.item a[class$="'+link+'"]'); + } + if (a && a.length) { + a.parent().parent().addClass('selected'); + a.parent().parent().attr('id','selected'); + highlightAnchor(); + } else if (n) { + $(n.itemDiv).addClass('selected'); + $(n.itemDiv).attr('id','selected'); + } + var topOffset=5; + if (typeof page_layout!=='undefined' && page_layout==1) { + topOffset+=$('#top').outerHeight(); + } + if ($('#nav-tree-contents .item:first').hasClass('selected')) { + topOffset+=25; + } + $('#nav-sync').css('top',topOffset+'px'); + showRoot(); +} + +function showNode(o, node, index, hash) +{ + if (node && node.childrenData) { + if (typeof(node.childrenData)==='string') { + var varName = node.childrenData; + getScript(node.relpath+varName,function(){ + node.childrenData = getData(varName); + showNode(o,node,index,hash); + }); + } else { + if (!node.childrenVisited) { + getNode(o, node); + } + $(node.getChildrenUL()).css({'display':'block'}); + node.plus_img.innerHTML = arrowDown; + node.expanded = true; + var n = node.children[o.breadcrumbs[index]]; + if (index+11) hash = '#'+parts[1].replace(/[^\w\-]/g,''); + else hash=''; + } + if (hash.match(/^#l\d+$/)) { + var anchor=$('a[name='+hash.substring(1)+']'); + glowEffect(anchor.parent(),1000); // line number + hash=''; // strip line number anchors + } + var url=root+hash; + var i=-1; + while (NAVTREEINDEX[i+1]<=url) i++; + if (i==-1) { i=0; root=NAVTREE[0][1]; } // fallback: show index + if (navTreeSubIndices[i]) { + gotoNode(o,i,root,hash,relpath) + } else { + getScript(relpath+'navtreeindex'+i,function(){ + navTreeSubIndices[i] = eval('NAVTREEINDEX'+i); + if (navTreeSubIndices[i]) { + gotoNode(o,i,root,hash,relpath); + } + }); + } +} + +function showSyncOff(n,relpath) +{ + n.html(''); +} + +function showSyncOn(n,relpath) +{ + n.html(''); +} + +function toggleSyncButton(relpath) +{ + var navSync = $('#nav-sync'); + if (navSync.hasClass('sync')) { + navSync.removeClass('sync'); + showSyncOff(navSync,relpath); + storeLink(stripPath2(pathName())+hashUrl()); + } else { + navSync.addClass('sync'); + showSyncOn(navSync,relpath); + deleteLink(); + } +} + +var loadTriggered = false; +var readyTriggered = false; +var loadObject,loadToRoot,loadUrl,loadRelPath; + +$(window).on('load',function(){ + if (readyTriggered) { // ready first + navTo(loadObject,loadToRoot,loadUrl,loadRelPath); + showRoot(); + } + loadTriggered=true; +}); + +function initNavTree(toroot,relpath) +{ + var o = new Object(); + o.toroot = toroot; + o.node = new Object(); + o.node.li = document.getElementById("nav-tree-contents"); + o.node.childrenData = NAVTREE; + o.node.children = new Array(); + o.node.childrenUL = document.createElement("ul"); + o.node.getChildrenUL = function() { return o.node.childrenUL; }; + o.node.li.appendChild(o.node.childrenUL); + o.node.depth = 0; + o.node.relpath = relpath; + o.node.expanded = false; + o.node.isLast = true; + o.node.plus_img = document.createElement("span"); + o.node.plus_img.className = 'arrow'; + o.node.plus_img.innerHTML = arrowRight; + + if (localStorageSupported()) { + var navSync = $('#nav-sync'); + if (cachedLink()) { + showSyncOff(navSync,relpath); + navSync.removeClass('sync'); + } else { + showSyncOn(navSync,relpath); + } + navSync.click(function(){ toggleSyncButton(relpath); }); + } + + if (loadTriggered) { // load before ready + navTo(o,toroot,hashUrl(),relpath); + showRoot(); + } else { // ready before load + loadObject = o; + loadToRoot = toroot; + loadUrl = hashUrl(); + loadRelPath = relpath; + readyTriggered=true; + } + + $(window).bind('hashchange', function(){ + if (window.location.hash && window.location.hash.length>1){ + var a; + if ($(location).attr('hash')){ + var clslink=stripPath(pathName())+':'+hashValue(); + a=$('.item a[class$="'+clslink.replace(/ + + + + + + +Manifold: optional_assert.h Source File + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
optional_assert.h
+
+
+
1// Copyright 2022 The Manifold Authors.
+
2//
+
3// Licensed under the Apache License, Version 2.0 (the "License");
+
4// you may not use this file except in compliance with the License.
+
5// You may obtain a copy of the License at
+
6//
+
7// http://www.apache.org/licenses/LICENSE-2.0
+
8//
+
9// Unless required by applicable law or agreed to in writing, software
+
10// distributed under the License is distributed on an "AS IS" BASIS,
+
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+
12// See the License for the specific language governing permissions and
+
13// limitations under the License.
+
14
+
15#pragma once
+
16
+
17#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..efb32dda6 --- /dev/null +++ b/docs/html/pages.html @@ -0,0 +1,117 @@ + + + + + + + +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..5df06e6bc --- /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(size_t 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/plus.svg b/docs/html/plus.svg new file mode 100644 index 000000000..075201655 --- /dev/null +++ b/docs/html/plus.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/docs/html/plusd.svg b/docs/html/plusd.svg new file mode 100644 index 000000000..0c65bfe94 --- /dev/null +++ b/docs/html/plusd.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/docs/html/polygon_8h_source.html b/docs/html/polygon_8h_source.html new file mode 100644 index 000000000..fd8246883 --- /dev/null +++ b/docs/html/polygon_8h_source.html @@ -0,0 +1,159 @@ + + + + + + + +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
+
Definition vec_view.h:27
+
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:862
+
std::vector< SimplePolygon > Polygons
Definition public.h:124
+
Definition public.h:604
+
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:822
+
Definition polygon.h:29
+
Definition meshIO.h:20
+
+
+ + + + diff --git a/docs/html/polygon__corpus_8cpp_source.html b/docs/html/polygon__corpus_8cpp_source.html new file mode 100644 index 000000000..f22acb343 --- /dev/null +++ b/docs/html/polygon__corpus_8cpp_source.html @@ -0,0 +1,4856 @@ + + + + + + + +Manifold: polygon_corpus.cpp Source File + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
polygon_corpus.cpp
+
+
+
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// Note that this file is shared between the standard polygon test and fuzzer
+
16// seed.
+
17
+
23TEST(Polygon, SimpleHole) {
+
24 Polygons polys;
+
25 polys.push_back({
+
26 {0, -2}, //
+
27 {2, 2}, //
+
28 {0, 4}, //
+
29 {-3, 3}, //
+
30 });
+
31 polys.push_back({
+
32 {0, -1}, //
+
33 {-1, 1}, //
+
34 {1, 1}, //
+
35 });
+
36 TestPoly(polys, 7);
+
37}
+
38
+
39TEST(Polygon, SimpleHole2) {
+
40 Polygons polys;
+
41 polys.push_back({
+
42 {0, 1.63299}, //
+
43 {-1.41421, -0.816496}, //
+
44 {1.41421, -0.816496}, //
+
45 });
+
46 polys.push_back({
+
47 {0, 1.02062}, //
+
48 {0.883883, -0.51031}, //
+
49 {-0.883883, -0.51031}, //
+
50 });
+
51 TestPoly(polys, 6);
+
52}
+
53
+
54TEST(Polygon, MultiMerge) {
+
55 Polygons polys;
+
56 polys.push_back({
+
57 {-7, 0}, //
+
58 {-6, 3}, //
+
59 {-5, 1}, //
+
60 {-4, 6}, //
+
61 {-3, 2}, //
+
62 {-2, 5}, //
+
63 {-1, 4}, //
+
64 {0, 12}, //
+
65 {-6, 10}, //
+
66 {-8, 11}, //
+
67 });
+
68 polys.push_back({
+
69 {-5, 7}, //
+
70 {-6, 8}, //
+
71 {-5, 9}, //
+
72 });
+
73 TestPoly(polys, 13);
+
74}
+
75
+
76TEST(Polygon, SimpleHoles) {
+
77 Polygons polys;
+
78 polys.push_back({
+
79 {-0.277777791, 0.376543224}, //
+
80 {0.5, -0.233333275}, //
+
81 {0.285185158, 0.214814827}, //
+
82 });
+
83 polys.push_back({
+
84 {0.325617313, -0.055555556}, //
+
85 {0.277777791, 0.092592679}, //
+
86 {0.328042328, 0.0608465709}, //
+
87 });
+
88 polys.push_back({
+
89 {0.212963, 0.092592597}, //
+
90 {0.203703716, 0.141975299}, //
+
91 {0.212962985, 0.138888896}, //
+
92 });
+
93 TestPoly(polys, 11);
+
94}
+
95
+
96TEST(Polygon, SimpleHoles2) {
+
97 Polygons polys;
+
98 polys.push_back({
+
99 {-0.0185185187, 0.5}, //
+
100 {-0.5, 0.49253732}, //
+
101 {0.166666672, 0.0370370671}, //
+
102 {0.0617283992, 0.438271612}, //
+
103 });
+
104 polys.push_back({
+
105 {-0.179012358, 0.448559672}, //
+
106 {-0.179012358, 0.438271612}, //
+
107 {-0.188271582, 0.438271612}, //
+
108 });
+
109 polys.push_back({
+
110 {-0.413580239, 0.45679009}, //
+
111 {-0.401234567, 0.448559672}, //
+
112 {-0.401234567, 0.438271612}, //
+
113 });
+
114 polys.push_back({
+
115 {0.0308641978, 0.450617284}, //
+
116 {0.0432098769, 0.450617284}, //
+
117 {0.0493827164, 0.438271612}, //
+
118 });
+
119 TestPoly(polys, 17);
+
120}
+
121
+
122TEST(Polygon, Looping1) {
+
123 Polygons polys;
+
124 polys.push_back({
+
125 {0.f, -2.f}, //
+
126 {2.f, 2.f}, //
+
127 {0.f, 4.f}, //
+
128 {-3.f, 3.f}, //
+
129 });
+
130 polys.push_back({
+
131 {1.40282347e+38f, 1.40282347e+38f}, //
+
132 {-0.f, 0.f}, //
+
133 {0.f, 1.f}, //
+
134 {1.f, 0.f}, //
+
135 });
+
136 polys.push_back({
+
137 {0.f, -1.f}, //
+
138 {-1.f, 1.f}, //
+
139 {1.f, 1.f}, //
+
140 });
+
141 TestPoly(polys, 5);
+
142}
+
143
+
144TEST(Polygon, Looping2) {
+
145 Polygons polys;
+
146 polys.push_back({
+
147 {-0.277777791f, 0.376543224f}, //
+
148 {0.5f, -0.233333275f}, //
+
149 {0.285185158f, 0.214814827f}, //
+
150 });
+
151 polys.push_back({
+
152 {0.325617313f, -0.055555556f}, //
+
153 {0.277777791f, 0.092592679f}, //
+
154 {0.328042328f, 0.0608465709f}, //
+
155 });
+
156 polys.push_back({
+
157 {3.40282347e+38f, 0.283553332f}, //
+
158 {0.212963f, 0.092592597f}, //
+
159 {0.203703716f, 0.141975299f}, //
+
160 {0.212962985f, 0.138888896f}, //
+
161 });
+
162 TestPoly(polys, 4);
+
163}
+
164
+
165TEST(Polygon, AlignedHoles) {
+
166 Polygons polys;
+
167 polys.push_back({
+
168 {-0.391621143, 0.5}, //
+
169 {0.5, -0.305555522}, //
+
170 {0.5, -0.0629629567}, //
+
171 {0.214285731, 0.285714298}, //
+
172 });
+
173 polys.push_back({
+
174 {-0.174897119, 0.403292179}, //
+
175 {-0.179012358, 0.395061731}, //
+
176 {-0.19135803, 0.407407403}, //
+
177 });
+
178 polys.push_back({
+
179 {0.325617313, -0.055555556}, //
+
180 {0.277777791, -0.055555556}, //
+
181 {0.314176232, 0.0747126788}, //
+
182 });
+
183 polys.push_back({
+
184 {0.339506179, -0.0740740374}, //
+
185 {0.339506179, -0.0833333284}, //
+
186 {0.327160507, -0.0802469105}, //
+
187 });
+
188 polys.push_back({
+
189 {0.364197522, -0.129629627}, //
+
190 {0.314814836, -0.0802469477}, //
+
191 {0.351851851, -0.092592597}, //
+
192 });
+
193 polys.push_back({
+
194 {0.302469134, -0.0679012388}, //
+
195 {0.30864194, -0.0802469105}, //
+
196 {0.302469134, -0.0833332911}, //
+
197 });
+
198 TestPoly(polys, 27);
+
199}
+
200
+
201TEST(Polygon, Outers) {
+
202 Polygons polys;
+
203 polys.push_back({
+
204 {-4.95815706, 4.55738497}, //
+
205 {-4.85924578, 4.65629625}, //
+
206 {-4.85924578, 4.65629625}, //
+
207 {-4.91438103, 4.64493704}, //
+
208 {-4.91438103, 4.64493704}, //
+
209 {-4.95815706, 4.65629625}, //
+
210 {-4.95815706, 4.65629625}, //
+
211 {-4.95815706, 4.65629625}, //
+
212 });
+
213 polys.push_back({
+
214 {-4.95815706, 4.95815706}, //
+
215 {-4.95815706, 4.85725117}, //
+
216 {-4.95815706, 4.85725117}, //
+
217 {-4.95815706, 4.85725117}, //
+
218 {-4.95815706, 4.95815706}, //
+
219 {-4.90248775, 4.9224453}, //
+
220 {-4.87105799, 4.95158386}, //
+
221 {-4.87105799, 4.95158386}, //
+
222 {-4.85925102, 4.95815706}, //
+
223 });
+
224 polys.push_back({
+
225 {-4.55738497, 4.95815706}, //
+
226 {-4.65629101, 4.95815706}, //
+
227 {-4.65105772, 4.95158339}, //
+
228 {-4.64647388, 4.89330769}, //
+
229 {-4.64647388, 4.89330769}, //
+
230 {-4.65829086, 4.85725117}, //
+
231 {-4.65829086, 4.85725117}, //
+
232 });
+
233 TestPoly(polys, 18);
+
234}
+
235
+
236TEST(Polygon, Holes) {
+
237 Polygons polys;
+
238 polys.push_back({
+
239 {0.462962955, -0.5}, //
+
240 {0.462962955, 0.129629627}, //
+
241 {0.432784647, -0.314814836}, //
+
242 {0.462962955, -0.316186577}, //
+
243 {0.461591214, -0.351851851}, //
+
244 {0.431412905, -0.351851851}, //
+
245 {0.428669423, -0.42592594}, //
+
246 {0.462962955, -0.427297682}, //
+
247 {0.42592594, -0.5}, //
+
248 });
+
249 polys.push_back({
+
250 {0.438271612, -0.413122982}, //
+
251 {0.438728869, -0.401234567}, //
+
252 {0.450617284, -0.401691824}, //
+
253 });
+
254 polys.push_back({
+
255 {0.438271612, -0.302011877}, //
+
256 {0.438728869, -0.290123463}, //
+
257 {0.450617284, -0.29058072}, //
+
258 });
+
259 TestPoly(polys, 17);
+
260}
+
261
+
262TEST(Polygon, Holes2) {
+
263 Polygons polys;
+
264 polys.push_back({
+
265 {31.5, -40.5}, //
+
266 {31.5, 24.5602417}, //
+
267 {29.4397583, 22.5}, //
+
268 {28.5, 7.5}, //
+
269 {24.5602417, -22.5}, //
+
270 {31.5, -31.5}, //
+
271 {23.5843372, -31.5}, //
+
272 });
+
273 polys.push_back({
+
274 {30.5, -6.27108431}, //
+
275 {29.5, -5.72891569}, //
+
276 {30.2710838, -5.5}, //
+
277 });
+
278 polys.push_back({
+
279 {30.5, 18.5}, //
+
280 {29.5, 17.5}, //
+
281 {29.5, 18.5}, //
+
282 });
+
283 polys.push_back({
+
284 {30.5, 20.7289162}, //
+
285 {29.5, 21.2710838}, //
+
286 {30.2710838, 21.5}, //
+
287 });
+
288 TestPoly(polys, 20);
+
289};
+
290
+
291TEST(Polygon, Holes3) {
+
292 Polygons polys;
+
293 polys.push_back({
+
294 {0.154320985, 0.438271612}, //
+
295 {0.0802469105, 0.216049403}, //
+
296 {0.0555555634, 0.166666672}, //
+
297 {-0.166666672, -0.5}, //
+
298 {0.166666672, -0.5}, //
+
299 });
+
300 polys.push_back({
+
301 {0.141975313, -0.187242806}, //
+
302 {0.146090537, -0.179012358}, //
+
303 {0.154320985, -0.183127582}, //
+
304 });
+
305 polys.push_back({
+
306 {-0.00617283955, -0.187242806}, //
+
307 {-0.00205761334, -0.179012358}, //
+
308 {0.00617283955, -0.183127582}, //
+
309 });
+
310 polys.push_back({
+
311 {0.0679012388, 0.19135803}, //
+
312 {0.0802469105, 0.19135803}, //
+
313 {0.0802469105, 0.179012358}, //
+
314 });
+
315 polys.push_back({
+
316 {0.104938269, 0.257201672}, //
+
317 {0.104938269, 0.265432119}, //
+
318 {0.117283955, 0.265432119}, //
+
319 });
+
320 TestPoly(polys, 23);
+
321};
+
322
+
323TEST(Polygon, Holes4) {
+
324 Polygons polys;
+
325 polys.push_back({
+
326 {0.166666672, 0.5}, //
+
327 {0.129629627, 0.314814836}, //
+
328 {0.0802469105, 0.216049403}, //
+
329 {0.0555555634, 0.166666672}, //
+
330 {0.166666672, 0.0555555634}, //
+
331 {-0.166666672, -0.5}, //
+
332 {0.166666672, -0.5}, //
+
333 });
+
334 polys.push_back({
+
335 {0.1090535, 0.19135803}, //
+
336 {0.117283955, 0.187242806}, //
+
337 {0.113168724, 0.179012358}, //
+
338 });
+
339 polys.push_back({
+
340 {0.0679012388, 0.183127582}, //
+
341 {0.0679012388, 0.19135803}, //
+
342 {0.0802469105, 0.179012358}, //
+
343 });
+
344 polys.push_back({
+
345 {0.104938269, 0.257201672}, //
+
346 {0.104938269, 0.265432119}, //
+
347 {0.117283955, 0.265432119}, //
+
348 });
+
349 TestPoly(polys, 20);
+
350};
+
351
+
352TEST(Polygon, SmallHole) {
+
353 Polygons polys;
+
354 polys.push_back({
+
355 {8.93379593, -41.2573624}, //
+
356 {10.5178413, -41.2440758}, //
+
357 {8.99354267, -41.1997375}, //
+
358 });
+
359 polys.push_back({
+
360 {9.08317471, -41.2453728}, //
+
361 {9.08610725, -41.242527}, //
+
362 {9.0890007, -41.2397537}, //
+
363 {9.08943081, -41.2436409}, //
+
364 {9.08946514, -41.2439499}, //
+
365 {9.08924961, -41.2441826}, //
+
366 {9.0890007, -41.2444496}, //
+
367 });
+
368 TestPoly(polys, 10);
+
369};
+
370
+
371TEST(Polygon, Precision4) {
+
372 Polygons polys;
+
373 polys.push_back({
+
374 {-7.57671118, -12.7964983}, //
+
375 {-7.57698059, -12.796319}, //
+
376 {-7.57698631, -12.7967968}, //
+
377 {-7.63940859, -12.9102335}, //
+
378 {-7.58357, -12.7919359}, //
+
379 {-7.58663845, -12.7898951}, //
+
380 {-7.63940859, -12.9102335}, //
+
381 });
+
382 TestPoly(polys, 5, 0.0004);
+
383};
+
384
+
385TEST(Polygon, CoincidentHole) {
+
386 Polygons polys;
+
387 polys.push_back({
+
388 {9.82835007, -0.939956188}, //
+
389 {10.1291866, -1.12029469}, //
+
390 {10.1291866, -0.759618163}, //
+
391 });
+
392 polys.push_back({
+
393 {9.82835007, -0.939956307}, //
+
394 {10.053978, -0.80470264}, //
+
395 {9.97876835, -1.0301255}, //
+
396 });
+
397 TestPoly(polys, 6);
+
398};
+
399
+
400TEST(Polygon, Holes5) {
+
401 Polygons polys;
+
402 polys.push_back({
+
403 {-0.166666672, -0.166666672}, //
+
404 {-0.462962955, 0.42592594}, //
+
405 {-0.5, -0.5}, //
+
406 });
+
407 polys.push_back({
+
408 {-0.240740761, -0.129629627}, //
+
409 {-0.203703716, -0.092592597}, //
+
410 {-0.203703716, -0.092592597}, //
+
411 {-0.203703716, -0.129629627}, //
+
412 });
+
413 polys.push_back({
+
414 {-0.388888896, -0.055555556}, //
+
415 {-0.277777791, 0.055555556}, //
+
416 {-0.277777791, -0.055555556}, //
+
417 });
+
418 TestPoly(polys, 12);
+
419};
+
420
+
421TEST(Polygon, Holes6) {
+
422 Polygons polys;
+
423 polys.push_back({
+
424 {0.388888896, 0.277777791}, //
+
425 {0.277777791, 0.388888896}, //
+
426 {0.388888896, 0.388888896}, //
+
427 });
+
428 polys.push_back({
+
429 {0.055555556, 0.388888896}, //
+
430 {-0.055555556, 0.277777791}, //
+
431 {-0.055555556, 0.388888896}, //
+
432 });
+
433 polys.push_back({
+
434 {-0.277777791, 0.388888896}, //
+
435 {-0.388888896, 0.277777791}, //
+
436 {-0.388888896, 0.388888896}, //
+
437 });
+
438 polys.push_back({
+
439 {-0.5, -0.5}, //
+
440 {0.5, -0.5}, //
+
441 {0.5, 0.5}, //
+
442 {-0.5, 0.5}, //
+
443 });
+
444 TestPoly(polys, 17);
+
445};
+
446
+
447TEST(Polygon, Holes7) {
+
448 Polygons polys;
+
449 polys.push_back({
+
450 {0.203703731, -0.203703716}, //
+
451 {-0.388888896, 0.277777791}, //
+
452 {-0.5, -0.5}, //
+
453 });
+
454 polys.push_back({
+
455 {-0.129629627, -0.203703716}, //
+
456 {-0.092592597, -0.203703716}, //
+
457 {-0.092592597, -0.240740761}, //
+
458 });
+
459 polys.push_back({
+
460 {-0.351851851, -0.203703716}, //
+
461 {-0.314814836, -0.203703716}, //
+
462 {-0.314814836, -0.240740761}, //
+
463 });
+
464 TestPoly(polys, 11);
+
465};
+
466
+
467TEST(Polygon, Holes8) {
+
468 Polygons polys;
+
469 polys.push_back({
+
470 {-0.166666672, 0.166666672}, //
+
471 {-0.42592594, 0.42592594}, //
+
472 {-0.5, -0.5}, //
+
473 });
+
474 polys.push_back({
+
475 {-0.277777791, -0.055555556}, //
+
476 {-0.388888896, 0.055555556}, //
+
477 {-0.277777791, 0.055555556}, //
+
478 {-0.277777791, -0.055555556}, //
+
479 });
+
480 polys.push_back({
+
481 {-0.462962955, -0.129629627}, //
+
482 {-0.42592594, -0.092592597}, //
+
483 {-0.42592594, -0.129629627}, //
+
484 });
+
485 TestPoly(polys, 12);
+
486};
+
487
+
488TEST(Polygon, Holes9) {
+
489 Polygons polys;
+
490 polys.push_back({
+
491 {-0.166666672, -0.166666672}, //
+
492 {-0.166666672, 0.166666672}, //
+
493 {-0.166666657, 0.166666672}, //
+
494 {-0.462962955, 0.42592594}, //
+
495 {-0.5, -0.5}, //
+
496 });
+
497 polys.push_back({
+
498 {-0.277777791, -0.055555556}, //
+
499 {-0.277777791, -0.055555556}, //
+
500 {-0.388888896, 0.055555556}, //
+
501 {-0.277777791, 0.055555556}, //
+
502 });
+
503 polys.push_back({
+
504 {-0.462962955, -0.129629627}, //
+
505 {-0.42592594, -0.092592597}, //
+
506 {-0.42592594, -0.092592597}, //
+
507 {-0.42592594, -0.129629627}, //
+
508 });
+
509 TestPoly(polys, 15);
+
510};
+
511
+
512TEST(Polygon, Eberly) {
+
513 Polygons polys;
+
514 polys.push_back({
+
515 {0, 0}, //
+
516 {9, 0}, //
+
517 {7, -1}, //
+
518 {8, -1}, //
+
519 {10, -5}, //
+
520 {10, 3}, //
+
521 {0, 3}, //
+
522 });
+
523 polys.push_back({
+
524 {1, 1}, //
+
525 {1, 2}, //
+
526 {2, 1}, //
+
527 });
+
528 TestPoly(polys, 10);
+
529};
+
530
+
531TEST(Polygon, Ugly) {
+
532 Polygons polys;
+
533 polys.push_back({
+
534 {2379.21118, 13009.6982}, //
+
535 {2292.45776, 13566.7129}, //
+
536 {2048.95142, 13894.6953}, //
+
537 {2054.84497, 13878.9023}, //
+
538 {2055.11914, 13878.9707}, //
+
539 {2186.24487, 13527.4189}, //
+
540 {2186.24487, 13527.4189}, //
+
541 {2186.24487, 13527.4189}, //
+
542 {2189.47729, 13552.7422}, //
+
543 {2208.28711, 13577.457}, //
+
544 {2208.28711, 13577.457}, //
+
545 {2236.93433, 13589.4551}, //
+
546 {2236.93433, 13589.4551}, //
+
547 {2236.93433, 13589.4551}, //
+
548 {2208.28711, 13577.457}, //
+
549 {2292.45703, 13566.7129}, //
+
550 {2208.28711, 13577.457}, //
+
551 {2208.28711, 13577.457}, //
+
552 {2189.47729, 13552.7422}, //
+
553 {2189.47729, 13552.7422}, //
+
554 {2189.47729, 13552.7422}, //
+
555 {2222.25732, 13474.4775}, //
+
556 {2222.25732, 13474.4775}, //
+
557 {2222.25732, 13474.4775}, //
+
558 {2222.25732, 13474.4775}, //
+
559 {2222.25732, 13474.4775}, //
+
560 {2189.47729, 13552.7422}, //
+
561 {2186.24487, 13527.4189}, //
+
562 {2186.61182, 13525.8066}, //
+
563 {2222.38232, 13429.9521}, //
+
564 {2222.38232, 13429.9521}, //
+
565 {2222.38232, 13429.9521}, //
+
566 });
+
567 polys.push_back({
+
568 {2379.03198, 13010.5518}, //
+
569 {2378.89648, 13010.541}, //
+
570 {2289.28784, 13251.1582}, //
+
571 {2379.03027, 13010.5566}, //
+
572 });
+
573 TestPoly(polys, 32);
+
574};
+
575
+
576TEST(Polygon, Sponge4a) {
+
577 Polygons polys;
+
578 polys.push_back({
+
579 {0.166666672, -0.0555555671}, //
+
580 {0.216049403, -0.0720164701}, //
+
581 {0.216049403, -0.0679012388}, //
+
582 {0.220164627, -0.0679012388}, //
+
583 {0.228395075, -0.0679012388}, //
+
584 {0.228395075, -0.0720164627}, //
+
585 {0.228395075, -0.076131694}, //
+
586 {0.314814836, -0.104938284}, //
+
587 {0.314814836, -0.092592597}, //
+
588 {0.327160507, -0.092592597}, //
+
589 {0.351851851, -0.092592597}, //
+
590 {0.351851851, -0.104938276}, //
+
591 {0.351851851, -0.117283955}, //
+
592 {0.438271612, -0.146090537}, //
+
593 {0.438271612, -0.141975313}, //
+
594 {0.442386836, -0.141975313}, //
+
595 {0.450617284, -0.141975313}, //
+
596 {0.376543224, -0.104938284}, //
+
597 {0.376543224, -0.1090535}, //
+
598 {0.376543224, -0.117283955}, //
+
599 {0.372428, -0.117283955}, //
+
600 {0.364197552, -0.117283955}, //
+
601 {0.364197552, -0.113168724}, //
+
602 {0.364197552, -0.104938269}, //
+
603 {0.368312776, -0.104938269}, //
+
604 {0.376543194, -0.104938269}, //
+
605 {0.302469134, -0.0679012388}, //
+
606 {0.302469134, -0.0720164627}, //
+
607 {0.302469134, -0.0802469105}, //
+
608 {0.29835391, -0.0802469105}, //
+
609 {0.290123463, -0.0802469105}, //
+
610 {0.290123463, -0.0761316866}, //
+
611 {0.290123463, -0.0679012388}, //
+
612 {0.294238687, -0.0679012388}, //
+
613 {0.302469134, -0.0679012388}, //
+
614 {0.166666672, 0}, //
+
615 });
+
616 polys.push_back({
+
617 {0.179012358, -0.0432098769}, //
+
618 {0.179012358, -0.0390946493}, //
+
619 {0.179012358, -0.0308641978}, //
+
620 {0.183127582, -0.0308641978}, //
+
621 {0.19135803, -0.0308641978}, //
+
622 {0.19135803, -0.0349794254}, //
+
623 {0.19135803, -0.0432098769}, //
+
624 {0.187242806, -0.0432098769}, //
+
625 });
+
626 polys.push_back({
+
627 {0.216049403, -0.0432098769}, //
+
628 {0.216049403, -0.0390946493}, //
+
629 {0.216049403, -0.0308641978}, //
+
630 {0.220164627, -0.0308641978}, //
+
631 {0.228395075, -0.0308641978}, //
+
632 {0.228395075, -0.0349794254}, //
+
633 {0.228395075, -0.0432098769}, //
+
634 {0.224279851, -0.0432098769}, //
+
635 });
+
636 polys.push_back({
+
637 {0.253086448, -0.0802469105}, //
+
638 {0.253086448, -0.0761316866}, //
+
639 {0.253086448, -0.0679012388}, //
+
640 {0.257201672, -0.0679012388}, //
+
641 {0.265432119, -0.0679012388}, //
+
642 {0.265432119, -0.0720164627}, //
+
643 {0.265432119, -0.0802469105}, //
+
644 {0.261316895, -0.0802469105}, //
+
645 });
+
646 TestPoly(polys, 64);
+
647};
+
648
+
649TEST(Polygon, CoincidentHole2) {
+
650 Polygons polys;
+
651 polys.push_back({
+
652 {-6.53556156, 12.4571409}, //
+
653 {-6.72912979, 12.5610456}, //
+
654 {-6.7918272, 12.5019674}, //
+
655 });
+
656 polys.push_back({
+
657 {-6.72903824, 12.5008945}, //
+
658 {-6.72912979, 12.5008078}, //
+
659 {-6.72931194, 12.5008106}, //
+
660 {-6.7918272, 12.5019674}, //
+
661 {-6.72912979, 12.5610456}, //
+
662 {-6.72894907, 12.501153}, //
+
663 {-6.72894812, 12.5009804}, //
+
664 });
+
665 TestPoly(polys, 10, 0.0005);
+
666};
+
667
+
668TEST(Polygon, CoincidentHole3) {
+
669 Polygons polys;
+
670 polys.push_back({
+
671 {9.76247501, -8.75089836}, //
+
672 {9.78284931, -8.75129509}, //
+
673 {9.78242302, -8.75128555}, //
+
674 {9.76939392, -8.74437904}, //
+
675 {9.76939392, -8.74437904}, //
+
676 });
+
677 polys.push_back({
+
678 {9.76247501, -8.75089836}, //
+
679 {9.76939392, -8.74437904}, //
+
680 {9.77548981, -8.75115108}, //
+
681 {9.77501488, -8.7511425}, //
+
682 });
+
683 TestPoly(polys, 9, 0.0002);
+
684};
+
685
+
686TEST(Polygon, CoincidentHole4) {
+
687 Polygons polys;
+
688 polys.push_back({
+
689 {1.44564819, 9.71884632}, //
+
690 {1.48651409, 9.71884632}, //
+
691 {1.44735146, 9.76247501}, //
+
692 });
+
693 polys.push_back({
+
694 {1.4456495, 9.71884632}, //
+
695 {1.44564915, 9.71884632}, //
+
696 {1.44564879, 9.71884632}, //
+
697 {1.44564819, 9.71884632}, //
+
698 {1.44586205, 9.72430038}, //
+
699 {1.44992185, 9.72319221}, //
+
700 {1.44936395, 9.71884632}, //
+
701 });
+
702 TestPoly(polys, 10, 0.0002);
+
703};
+
704
+
705TEST(Polygon, Colinear) {
+
706 Polygons polys;
+
707 polys.push_back({
+
708 {-5.48368, -3.73905}, //
+
709 {-4.9881, -4.51552}, //
+
710 {-4.78988, -4.13186}, //
+
711 {-4.82012, -4.13999}, //
+
712 {-4.84314, -4.14617}, //
+
713 {-4.85738, -4.13581}, //
+
714 {-4.86772, -4.12831}, //
+
715 {-4.87337, -4.12422}, //
+
716 {-4.88097, -4.1187}, //
+
717 {-4.89799, -4.10634}, //
+
718 {-4.90219, -4.103290}, //
+
719 {-4.90826, -4.098871}, //
+
720 {-4.90846, -4.098732}, //
+
721 {-4.91227, -4.095973}, //
+
722 {-4.92199, -4.08894}, //
+
723 {-5.0245, -4.014435}, //
+
724 {-5.02494, -4.014126}, //
+
725 {-5.02536, -4.013817}, //
+
726 {-5.0316, -4.009278}, //
+
727 {-5.03211, -4.008919}, //
+
728 {-5.05197, -3.994480}, //
+
729 {-5.14757, -3.925041}, //
+
730 {-5.21287, -3.87762}, //
+
731 {-5.29419, -3.818533}, //
+
732 {-5.29907, -3.814994}, //
+
733 {-5.36732, -3.765415}, //
+
734 });
+
735 TestPoly(polys, 24);
+
736}
+
737
+
738TEST(Polygon, Colinear4) {
+
739 Polygons polys;
+
740 polys.push_back({
+
741 {-22.7753239, 8.03145695}, //
+
742 {-22.8791199, 8.04628658}, //
+
743 {-22.8791199, 8.0424366}, //
+
744 {-22.8792648, 8.04237938}, //
+
745 {-22.8794041, 8.04239368}, //
+
746 {-22.9786491, 8.05282307}, //
+
747 {-22.9923439, 8.06109047}, //
+
748 {-22.995327, 8.06289101}, //
+
749 {-23.0484314, 8.07047844}, //
+
750 {-23.056942, 8.06713009}, //
+
751 {-23.0641346, 8.06429958}, //
+
752 {-23.0679455, 8.06355}, //
+
753 {-23.0689487, 8.06335258}, //
+
754 {-23.0691357, 8.06331635}, //
+
755 {-23.0723953, 8.06429958}, //
+
756 {-23.1114883, 8.0794878}, //
+
757 {-24.4342442, 8.26848221}, //
+
758 {-24.4342442, 8.2057848}, //
+
759 });
+
760 TestPoly(polys, 16, 0.0004);
+
761}
+
762
+
763TEST(Polygon, Merges) {
+
764 Polygons polys;
+
765 polys.push_back({
+
766 {-3.22039, 10.2769}, //
+
767 {-3.12437, 10.4147}, //
+
768 {-3.99093, 10.1781}, //
+
769 {-3.8154, 10.0716}, //
+
770 {-3.78982, 10.0893}, //
+
771 {-3.55033, 10.2558}, //
+
772 {-3.50073, 10.2549}, //
+
773 {-3.47018, 10.2572}, //
+
774 {-3.42633, 10.2605}, //
+
775 {-3.34311, 10.2604}, //
+
776 {-3.32096, 10.26330}, //
+
777 });
+
778 TestPoly(polys, 9);
+
779}
+
780
+
781TEST(Polygon, ExtraTriangle) {
+
782 Polygons polys;
+
783 polys.push_back({
+
784 {1.23141634, -0.493547261}, //
+
785 {1.23142254, -0.493540883}, //
+
786 {1.23088336, -0.457464248}, //
+
787 });
+
788 polys.push_back({
+
789 {1.23146737, -0.493494928}, //
+
790 {1.47253549, -0.24623163}, //
+
791 {1.47253144, -0.246230021}, //
+
792 {1.47166216, -0.246238187}, //
+
793 {1.46963537, -0.24623026}, //
+
794 {1.46811843, -0.246224999}, //
+
795 {1.46594918, -0.246223733}, //
+
796 {1.46594965, -0.2462321670}, //
+
797 {1.46594965, -0.2462322411}, //
+
798 {1.46594083, -0.2462237332}, //
+
799 {1.46591508, -0.2462237183}, //
+
800 {1.46594179, -0.2462314374}, //
+
801 {1.46585774, -0.2462236885}, //
+
802 {1.46577716, -0.2462236296}, //
+
803 {1.46590662, -0.2462312137}, //
+
804 {1.46550393, -0.2462234658}, //
+
805 {1.46081161, -0.2462207389}, //
+
806 {1.46407437, -0.2462289040}, //
+
807 {1.45568836, -0.2462277561}, //
+
808 {1.42199826, -0.2602537572}, //
+
809 {1.40801644, -0.2462047343}, //
+
810 {1.40688479, -0.246203084}, //
+
811 {1.38571239, -0.2461840815}, //
+
812 {1.30817795, -0.2461582426}, //
+
813 {1.28997684, -0.3280568727}, //
+
814 {1.30974603, -0.3150095348}, //
+
815 {1.31756043, -0.3649175179}, //
+
816 });
+
817 TestPoly(polys, 26);
+
818}
+
819
+
820TEST(Polygon, SpongeThin) {
+
821 Polygons polys;
+
822 polys.push_back({
+
823 {-0.5, -0.4753086571}, //
+
824 {-0.487654328, -0.4754610662}, //
+
825 {-0.487654328, -0.4753086573}, //
+
826 {-0.487654328, -0.4753086574}, //
+
827 {-0.487654328, -0.4753086575}, //
+
828 {-0.475308657, -0.4753086576}, //
+
829 {-0.475308657, -0.4756134757}, //
+
830 {-0.462962985, -0.4757659148}, //
+
831 {-0.462962985, -0.4753086579}, //
+
832 });
+
833 polys.push_back({
+
834 {0.42592591, -0.4753086570}, //
+
835 {0.351851851, -0.4753086571}, //
+
836 {0.351851851, -0.4753086572}, //
+
837 {0.351851851, -0.485825333}, //
+
838 {0.364197552, -0.4859777694}, //
+
839 {0.364197552, -0.4753086575}, //
+
840 {0.364197552, -0.4753086576}, //
+
841 {0.364197552, -0.4753086577}, //
+
842 {0.376543224, -0.4753086578}, //
+
843 {0.376543224, -0.4861301789}, //
+
844 {0.401234567, -0.4864349960}, //
+
845 {0.401234567, -0.4753086571}, //
+
846 {0.401234567, -0.4753086572}, //
+
847 {0.401234567, -0.4753086573}, //
+
848 {0.413580239, -0.4753086574}, //
+
849 {0.413580239, -0.4865874055}, //
+
850 {0.42592591, -0.4867398446}, //
+
851 });
+
852 polys.push_back({
+
853 {0.314814806, -0.4753086577}, //
+
854 {0.240740761, -0.4753086578}, //
+
855 {0.240740761, -0.4753086579}, //
+
856 {0.240740761, -0.4844535890}, //
+
857 {0.253086448, -0.4846060281}, //
+
858 {0.253086448, -0.4753086572}, //
+
859 {0.253086448, -0.4753086573}, //
+
860 {0.253086448, -0.4753086574}, //
+
861 {0.265432119, -0.4753086575}, //
+
862 {0.265432119, -0.4847584376}, //
+
863 {0.290123463, -0.4850632557}, //
+
864 {0.290123463, -0.4753086578}, //
+
865 {0.290123463, -0.4753086579}, //
+
866 {0.290123463, -0.4753086570}, //
+
867 {0.302469134, -0.4753086571}, //
+
868 {0.302469134, -0.4852156642}, //
+
869 {0.314814806, -0.4853681033}, //
+
870 {0.314814806, -0.4753086574}, //
+
871 });
+
872 TestPoly(polys, 38);
+
873}
+
874
+
875TEST(Polygon, ColinearY) {
+
876 Polygons polys;
+
877 polys.push_back({
+
878 {0, 0}, //
+
879 {1, 1}, //
+
880 {2, 1}, //
+
881 {3, 1}, //
+
882 {4, 1}, //
+
883 {4, 2}, //
+
884 {3, 2}, //
+
885 {2, 2}, //
+
886 {1, 2}, //
+
887 {0, 3}, //
+
888 {-1, 2}, //
+
889 {-2, 2}, //
+
890 {-3, 2}, //
+
891 {-4, 2}, //
+
892 {-4, 1}, //
+
893 {-3, 1}, //
+
894 {-2, 1}, //
+
895 {-1, 1}, //
+
896 });
+
897 TestPoly(polys, 16);
+
898}
+
899
+
900TEST(Polygon, NearlyColinearY) {
+
901 Polygons polys;
+
902 polys.push_back({
+
903 {3.5, 0}, //
+
904 {3.0, 0.5}, //
+
905 {3.0, 0.0144}, //
+
906 {2.0, 0.4}, //
+
907 {1.8, 0.1}, //
+
908 {1.6, 0.0155}, //
+
909 {1.5, 0.0147}, //
+
910 {1.4, 0.0144}, //
+
911 {1.0, 0.1}, //
+
912 {0, 0}, //
+
913 });
+
914 TestPoly(polys, 8, 0.001);
+
915}
+
916
+
917TEST(Polygon, Concave) {
+
918 Polygons polys;
+
919 polys.push_back({
+
920 {-0.707107008, -0.707107008}, //
+
921 {1, 0}, //
+
922 {0.683013022, 0}, //
+
923 {0.379409999, -0.232962996}, //
+
924 {0.379409999, -0.232962996}, //
+
925 {1.49012003e-08, -0.183013007}, //
+
926 {1.49012003e-08, -0.183013007}, //
+
927 {-0.140431002, 0}, //
+
928 {-1, 0}, //
+
929 });
+
930 TestPoly(polys, 7);
+
931}
+
932
+
933TEST(Polygon, Concave2) {
+
934 Polygons polys;
+
935 polys.push_back({
+
936 {4, 0}, //
+
937 {3, 2}, //
+
938 {3, 3}, //
+
939 {6, 5}, //
+
940 {6, 14}, //
+
941 {0, 13}, //
+
942 {0, 12}, //
+
943 {3, 11}, //
+
944 {4, 10}, //
+
945 {5, 8}, //
+
946 {1, 7}, //
+
947 {2, 1}, //
+
948 });
+
949 TestPoly(polys, 10);
+
950}
+
951
+
952TEST(Polygon, Sliver) {
+
953 Polygons polys;
+
954 polys.push_back({
+
955 {2.82002997, 0}, //
+
956 {2.82002997, 0}, //
+
957 {2.06105995, 0}, //
+
958 {2.05792999, 0.0680378973}, //
+
959 {2.06410003, 0.206908002}, //
+
960 {2.28446007, 1.04696}, //
+
961 {2.35005999, 1.24989998}, //
+
962 {-2.82002997, 15}, //
+
963 {-2.82002997, 0}, //
+
964 });
+
965 TestPoly(polys, 7);
+
966}
+
967
+
968TEST(Polygon, Duplicate) {
+
969 Polygons polys;
+
970 polys.push_back({
+
971 {-32.0774002, -10.4309998}, //
+
972 {-31.7346992, -6.10348988}, //
+
973 {-31.8645992, -5.61858988}, //
+
974 {-31.8645992, -5.61858988}, //
+
975 {-31.8645992, -5.61858988}, //
+
976 {-31.8645992, -5.61858988}, //
+
977 {-31.8645992, -5.61858988}, //
+
978 {-31.8645992, -5.61858988}, //
+
979 {-31.8645992, -5.61858988}, //
+
980 {-31.8645992, -5.61858988}, //
+
981 {-31.8645992, -5.618589880}, //
+
982 {-31.8645992, -5.618589881}, //
+
983 {-31.8645992, -5.618589882}, //
+
984 {-31.8645992, -5.618589883}, //
+
985 {-31.8645992, -5.618589884}, //
+
986 {-31.8645992, -5.618589885}, //
+
987 {-31.8645992, -5.618589886}, //
+
988 {-31.8645992, -5.618589887}, //
+
989 {-31.8645992, -5.618589888}, //
+
990 {-31.8645992, -5.618589889}, //
+
991 {-31.8645992, -5.618589880}, //
+
992 {-32.0774002, -3.18654991}, //
+
993 });
+
994 TestPoly(polys, 20);
+
995}
+
996
+
997TEST(Polygon, Folded) {
+
998 Polygons polys;
+
999 polys.push_back({
+
1000 {2.82002997, 0}, //
+
1001 {1.23706996, 4.20994997}, //
+
1002 {1.14140999, 4.09090996}, //
+
1003 {1.05895996, 3.94496012}, //
+
1004 {0.00757742021, 2.72726989}, //
+
1005 {-0.468091995, 1.94363999}, //
+
1006 {-1.06106997, 1.36363995}, //
+
1007 {-1.79214001, 0.346489996}, //
+
1008 {-2.27416992, 0}, //
+
1009 {-2.82002997, 0}, //
+
1010 {-2.82002997, 0}, //
+
1011 });
+
1012 TestPoly(polys, 9);
+
1013}
+
1014
+
1015TEST(Polygon, NearlyLinear) {
+
1016 Polygons polys;
+
1017 polys.push_back({
+
1018 {2.82002997, -8.22814036e-05}, //
+
1019 {2.82002997, -8.22814036e-05}, //
+
1020 {2.31802011, -8.22814036e-05}, //
+
1021 {-0.164566994, -8.22813017e-05}, //
+
1022 {-0.85738802, -8.22814036e-05}, //
+
1023 {-1.01091003, -8.22814036e-05}, //
+
1024 {-1.01091003, -8.22814036e-05}, //
+
1025 });
+
1026 TestPoly(polys, 5);
+
1027}
+
1028
+
1029TEST(Polygon, Sliver2) {
+
1030 Polygons polys;
+
1031 polys.push_back({
+
1032 {27.4996014, 8.68737034}, //
+
1033 {28.27701, 9.528873446}, //
+
1034 {27.6687469, 10.881158804}, //
+
1035 {27.5080414, 8.7968292242}, //
+
1036 {27.5594807, 8.7521896407}, //
+
1037 {27.4996014, 8.687370368}, //
+
1038 });
+
1039 TestPoly(polys, 4);
+
1040}
+
1041
+
1042TEST(Polygon, Sliver3) {
+
1043 Polygons polys;
+
1044 polys.push_back({
+
1045 {0, -2.6516838169}, //
+
1046 {0, -0.792692184889}, //
+
1047 {0, -0.792692184330}, //
+
1048 {0, -1.04356134430}, //
+
1049 {-0.953957975, -0.768045247331}, //
+
1050 {-1.36363637, -0.757460594892}, //
+
1051 });
+
1052 TestPoly(polys, 4);
+
1053}
+
1054
+
1055TEST(Polygon, Sliver4) {
+
1056 Polygons polys;
+
1057 polys.push_back({
+
1058 {-0.375669807, 8.90489388474}, //
+
1059 {0, 8.39722729459}, //
+
1060 {0, 8.9723053468}, //
+
1061 {0, 8.9723053469}, //
+
1062 {0, 8.96719646467}, //
+
1063 {0, 8.89326191466}, //
+
1064 {0, 8.78047276465}, //
+
1065 {-0.330551624, 8.8897438473}, //
+
1066 });
+
1067 TestPoly(polys, 6);
+
1068}
+
1069
+
1070TEST(Polygon, Sliver5) {
+
1071 Polygons polys;
+
1072 polys.push_back({
+
1073 {-60, 0}, //
+
1074 {-50, 0}, //
+
1075 {-50, 0}, //
+
1076 {-60, 4.37113897e-07}, //
+
1077 {-60, 4.37113897e-07}, //
+
1078 });
+
1079 polys.push_back({
+
1080 {-60, 100}, //
+
1081 {-60, 4.37113897e-07}, //
+
1082 {-60, 4.37113897e-07}, //
+
1083 {-50, 0}, //
+
1084 });
+
1085 TestPoly(polys, 5);
+
1086}
+
1087
+
1088TEST(Polygon, Sliver6) {
+
1089 Polygons polys;
+
1090 polys.push_back({
+
1091 {10, 0}, //
+
1092 {0, 10}, //
+
1093 {-10, 0}, //
+
1094 {-10, 0}, //
+
1095 {4.37113897e-07, 10}, //
+
1096 {10, 0}, //
+
1097 });
+
1098 TestPoly(polys, 4);
+
1099}
+
1100
+
1101TEST(Polygon, Sliver7) {
+
1102 Polygons polys;
+
1103 polys.push_back({
+
1104 {50, -10}, //
+
1105 {60, 0}, //
+
1106 {50, 0}, //
+
1107 {60, 4.37113897e-07}, //
+
1108 {60, 4.37113897e-07}, //
+
1109 {60, 4.37113897e-07}, //
+
1110 {60, 4.37113897e-07}, //
+
1111 {50, 0}, //
+
1112 });
+
1113 TestPoly(polys, 6);
+
1114}
+
1115
+
1116TEST(Polygon, Sliver8) {
+
1117 Polygons polys;
+
1118 polys.push_back({
+
1119 {27.9279995, 4.9749999}, //
+
1120 {31.0610008, 2.32299995}, //
+
1121 {31.0610008, 2.322999958}, //
+
1122 {27.9279995, 4.97499996}, //
+
1123 {27.9279995, 4.97499995}, //
+
1124 {31.0610008, 2.322999958}, //
+
1125 {30.4400005, 5.341000087}, //
+
1126 });
+
1127 TestPoly(polys, 5);
+
1128}
+
1129
+
1130TEST(Polygon, Sliver9) {
+
1131 Polygons polys;
+
1132 polys.push_back({
+
1133 {1.49183154, -0.4795963766194}, //
+
1134 {1.71669781, -0.2464189836195}, //
+
1135 {1.70233643, -0.2464101176196}, //
+
1136 {1.47253978, -0.2462775866197}, //
+
1137 {1.47254002, -0.2462870037997}, //
+
1138 {1.4869014, -0.2462958697996}, //
+
1139 });
+
1140 TestPoly(polys, 4);
+
1141}
+
1142
+
1143TEST(Polygon, Colinear2) {
+
1144 Polygons polys;
+
1145 polys.push_back({
+
1146 {11.7864399, -7.4572401176}, //
+
1147 {11.6818037, -7.309823044873}, //
+
1148 {11.6777582, -7.306262028498}, //
+
1149 {11.6789398, -7.305788044872}, //
+
1150 {11.3459997, -6.83671999889}, //
+
1151 {11.25597, -6.9267602888}, //
+
1152 });
+
1153 TestPoly(polys, 4);
+
1154}
+
1155
+
1156TEST(Polygon, Colinear3) {
+
1157 Polygons polys;
+
1158 polys.push_back({
+
1159 {1, -0.600000024}, //
+
1160 {1, 0.600000024}, //
+
1161 {0, 0.600000024}, //
+
1162 {0.5, 0}, //
+
1163 {0.5, 0.5}, //
+
1164 {0.5, 0.5}, //
+
1165 {1, 0.5}, //
+
1166 {1, -0.5}, //
+
1167 {1, -0.5}, //
+
1168 {1, -0.5}, //
+
1169 {0.916666627, -0.5}, //
+
1170 });
+
1171 TestPoly(polys, 9);
+
1172}
+
1173
+
1174TEST(Polygon, Envelope) {
+
1175 Polygons polys;
+
1176 polys.push_back({
+
1177 {-36.324749, 0.477457494}, //
+
1178 {-36.324749, 0.477457494}, //
+
1179 {-36.8497353, 1.03053689}, //
+
1180 {-32.5569077, 5}, //
+
1181 {-36.8497353, 1.03053689}, //
+
1182 });
+
1183 polys.push_back({
+
1184 {-32.5569077, 5}, //
+
1185 {-36.324749, 0.477457494}, //
+
1186 {-32.5569077, 5}, //
+
1187 {-32.5569077, 5}, //
+
1188 {-36.8497353, 1.03053689}, //
+
1189 });
+
1190 TestPoly(polys, 6);
+
1191}
+
1192
+
1193TEST(Polygon, Split) {
+
1194 Polygons polys;
+
1195 polys.push_back({
+
1196 {-0.707106769, -0.707106769}, //
+
1197 {1, 0}, //
+
1198 {0.683012664, 0}, //
+
1199 {0.379409522, -0.2329629063}, //
+
1200 {0.379409522, -0.2329629062}, //
+
1201 {1.49011612e-08, -0.1830126641}, //
+
1202 {1.49011612e-08, -0.1830126640}, //
+
1203 {-0.14043057, 0}, //
+
1204 {-1, 0}, //
+
1205 });
+
1206 TestPoly(polys, 7);
+
1207}
+
1208
+
1209TEST(Polygon, Duplicates) {
+
1210 Polygons polys;
+
1211 polys.push_back({
+
1212 {-15, -8.10255623648}, //
+
1213 {-15, -9.02439785650}, //
+
1214 {-13.636364, -9.4640789678}, //
+
1215 {-14.996314, -8.10623646916}, //
+
1216 {-15, -8.10639845}, //
+
1217 {-15, -8.10255623922}, //
+
1218 });
+
1219 TestPoly(polys, 4);
+
1220}
+
1221
+
1222TEST(Polygon, Simple1) {
+
1223 Polygons polys;
+
1224 polys.push_back({
+
1225 {4.04059982, -4.01843977872}, //
+
1226 {3.95867562, -4.252639774604}, //
+
1227 {4.23459578, -4.301384938274}, //
+
1228 {4.235569, -4.301272878273}, //
+
1229 {4.23782539, -4.301418784602}, //
+
1230 });
+
1231 TestPoly(polys, 3);
+
1232}
+
1233
+
1234TEST(Polygon, Simple2) {
+
1235 Polygons polys;
+
1236 polys.push_back({
+
1237 {-1, -1}, //
+
1238 {-0.5, -0.5}, //
+
1239 {-1, 0}, //
+
1240 {0, 1}, //
+
1241 {0.5, 0.50}, //
+
1242 {1, 1}, //
+
1243 {-1, 1}, //
+
1244 });
+
1245 TestPoly(polys, 5);
+
1246}
+
1247
+
1248TEST(Polygon, Simple3) {
+
1249 Polygons polys;
+
1250 polys.push_back({
+
1251 {19.7193489, 6.154459959798}, //
+
1252 {20.2308197, 5.642990591187}, //
+
1253 {20.3464642, 5.654597767273}, //
+
1254 {20.3733711, 5.654040817274}, //
+
1255 {20.373394, 5.654040341188}, //
+
1256 {20.8738098, 6.154459959801}, //
+
1257 });
+
1258 TestPoly(polys, 4);
+
1259}
+
1260
+
1261TEST(Polygon, Simple4) {
+
1262 Polygons polys;
+
1263 polys.push_back({
+
1264 {15, -12.713556387}, //
+
1265 {15, -10.684373988}, //
+
1266 {15, -10.684373992}, //
+
1267 {15, -11.004141813}, //
+
1268 {15, -11.455074309}, //
+
1269 {15, -11.455074311}, //
+
1270 {14.9958763, -11.454532608}, //
+
1271 {14.4307623, -11.380221412}, //
+
1272 {13.9298496, -11.276861280}, //
+
1273 });
+
1274 TestPoly(polys, 7);
+
1275}
+
1276
+
1277TEST(Polygon, Simple5) {
+
1278 Polygons polys;
+
1279 polys.push_back({
+
1280 {-27.3845081, 0.37566974864}, //
+
1281 {-27.6389656, 0}, //
+
1282 {-27.1156006, 0}, //
+
1283 {-27.1156006, 0}, //
+
1284 {-27.1202412, 0}, //
+
1285 {-27.1875362, 0}, //
+
1286 {-27.290184, 0}, //
+
1287 {-27.3733444, 0.33045187663}, //
+
1288 });
+
1289 TestPoly(polys, 6);
+
1290}
+
1291
+
1292TEST(Polygon, Simple6) {
+
1293 Polygons polys;
+
1294 polys.push_back({
+
1295 {-7.99813318, 12.88888265009}, //
+
1296 {-7.85714436, 12.91251955006}, //
+
1297 {-7.85714436, 12.98071965005}, //
+
1298 {-7.88929749, 12.95930395007}, //
+
1299 {-7.99812126, 12.88889125008}, //
+
1300 });
+
1301 TestPoly(polys, 3);
+
1302}
+
1303
+
1304TEST(Polygon, TouchingHole) {
+
1305 Polygons polys;
+
1306 polys.push_back({
+
1307 {-2, -1}, //
+
1308 {2, -1}, //
+
1309 {2, 1}, //
+
1310 {-2, 1}, //
+
1311 });
+
1312 polys.push_back({
+
1313 {-1, -1}, //
+
1314 {-1, 1}, //
+
1315 {1, 1}, //
+
1316 {1, -1}, //
+
1317 });
+
1318 TestPoly(polys, 8);
+
1319}
+
1320
+
1321TEST(Polygon, TouchingHole2) {
+
1322 Polygons polys;
+
1323 polys.push_back({
+
1324 {-0.314814836, -0.462962955}, //
+
1325 {-0.240740761, -0.462962955}, //
+
1326 {-0.314814836, -0.42592594}, //
+
1327 });
+
1328 polys.push_back({
+
1329 {-0.302469134, -0.450617284}, //
+
1330 {-0.302469134, -0.439186096}, //
+
1331 {-0.302469134, -0.438271612}, //
+
1332 {-0.291037947, -0.438271612}, //
+
1333 {-0.290123463, -0.438271612}, //
+
1334 {-0.290123463, -0.449702799}, //
+
1335 {-0.290123463, -0.450617284}, //
+
1336 {-0.30155465, -0.450617284}, //
+
1337 });
+
1338 TestPoly(polys, 11);
+
1339}
+
1340
+
1341TEST(Polygon, Degenerate) {
+
1342 Polygons polys;
+
1343 polys.push_back({
+
1344 {1, -1}, //
+
1345 {1, 1}, //
+
1346 {1, 1}, //
+
1347 {1, -1}, //
+
1348 {1, -1}, //
+
1349 {-1, -1}, //
+
1350 {-1, -1}, //
+
1351 });
+
1352 TestPoly(polys, 5);
+
1353}
+
1354
+
1355TEST(Polygon, Degenerate2) {
+
1356 Polygons polys;
+
1357 polys.push_back({
+
1358 {0.0740740597, -0.314814836829}, //
+
1359 {0.0925925896, -0.314814806828}, //
+
1360 {0.0925925896, -0.314814806826}, //
+
1361 {0.0740740597, -0.314814836830}, //
+
1362 });
+
1363 TestPoly(polys, 2);
+
1364}
+
1365
+
1366TEST(Polygon, Degenerate3) {
+
1367 Polygons polys;
+
1368 polys.push_back({
+
1369 {-0.413580239, -0.2160494039696}, //
+
1370 {-0.42592591, -0.2160494039690}, //
+
1371 {-0.413580239, -0.2160494039694}, //
+
1372 {-0.401234567, -0.2160494039713}, //
+
1373 {-0.401234567, -0.2160494039715}, //
+
1374 {-0.401234567, -0.2160494039716}, //
+
1375 {-0.413580239, -0.2160494039697}, //
+
1376 });
+
1377 TestPoly(polys, 5);
+
1378}
+
1379
+
1380TEST(Polygon, Degenerate4) {
+
1381 Polygons polys;
+
1382 polys.push_back({
+
1383 {0, 10}, //
+
1384 {-0.0696326792, 9.9939079360}, //
+
1385 {4.37113897e-07, 10}, //
+
1386 {0.636729717, 9.9442930240}, //
+
1387 });
+
1388 TestPoly(polys, 2);
+
1389}
+
1390
+
1391TEST(Polygon, Degenerate5) {
+
1392 Polygons polys;
+
1393 polys.push_back({
+
1394 {1, 0}, //
+
1395 {1, 1}, //
+
1396 {1, 1}, //
+
1397 {1, 1}, //
+
1398 {1, 1}, //
+
1399 {0, 1}, //
+
1400 {0, 1}, //
+
1401 {0, 1}, //
+
1402 });
+
1403 TestPoly(polys, 6);
+
1404}
+
1405
+
1406TEST(Polygon, Degenerate6) {
+
1407 Polygons polys;
+
1408 polys.push_back({
+
1409 {4.37113897e-07, -4.37113897e-07}, //
+
1410 {4.37113897e-07, 0}, //
+
1411 {0, 0}, //
+
1412 {-1.19421679e-06, 0}, //
+
1413 {-8.66025352, 0}, //
+
1414 {-8.66025352, 1.3397469}, //
+
1415 {-10, -4.37113897e-07}, //
+
1416 });
+
1417 TestPoly(polys, 5);
+
1418}
+
1419
+
1420TEST(Polygon, Tricky) {
+
1421 Polygons polys;
+
1422 polys.push_back({
+
1423 {1, 0}, //
+
1424 {2, 1}, //
+
1425 {3, 0}, //
+
1426 {3, 5}, //
+
1427 {2, 5}, //
+
1428 {3, 4}, //
+
1429 {3, 2}, //
+
1430 {3, 3}, //
+
1431 {0, 6}, //
+
1432 });
+
1433 TestPoly(polys, 7);
+
1434}
+
1435
+
1436TEST(Polygon, Tricky2) {
+
1437 Polygons polys;
+
1438 polys.push_back({
+
1439 {1, 0}, //
+
1440 {3, 1}, //
+
1441 {3, 3.5}, //
+
1442 {3, 0}, //
+
1443 {3, 5}, //
+
1444 {2, 5}, //
+
1445 {3, 4}, //
+
1446 {3, 2}, //
+
1447 {3, 3}, //
+
1448 {0, 6}, //
+
1449 });
+
1450 TestPoly(polys, 8);
+
1451}
+
1452
+
1453TEST(Polygon, Slit) {
+
1454 Polygons polys;
+
1455 polys.push_back({
+
1456 {27.7069321, 13.514409186}, //
+
1457 {28.664566, 10.810289467}, //
+
1458 {28.7565536, 10.818337466}, //
+
1459 {25.9535275, 19.445167570}, //
+
1460 {26.0820198, 18.928167365}, //
+
1461 {26.0820198, 18.928167364}, //
+
1462 {26.0820198, 18.928167366}, //
+
1463 {25.8192234, 18.844831567}, //
+
1464 {27.7069321, 13.514409185}, //
+
1465 {27.9789181, 13.211655684}, //
+
1466 });
+
1467 polys.push_back({
+
1468 {25.6960907, 20.237478391}, //
+
1469 {25.6563644, 20.359741292}, //
+
1470 {25.6467285, 20.361473193}, //
+
1471 });
+
1472 TestPoly(polys, 9);
+
1473}
+
1474
+
1475TEST(Polygon, SharedEdge) {
+
1476 Polygons polys;
+
1477 polys.push_back({
+
1478 {0.265432119, 0.00617283491185}, //
+
1479 {0.277777791, -3.7252903e-09}, //
+
1480 {0.277777791, 0.01851851871184}, //
+
1481 {0.240740761, 0.01851851876345}, //
+
1482 {0.265432119, 0.006172839551186}, //
+
1483 {0.265432119, 0.006172839551187}, //
+
1484 });
+
1485 TestPoly(polys, 4);
+
1486}
+
1487
+
1488TEST(Polygon, Precision) {
+
1489 Polygons polys;
+
1490 polys.push_back({
+
1491 {-0.98486793, -0.492948532}, //
+
1492 {-0.984859049, -0.492013603}, //
+
1493 {-0.984966695, -0.489926398}, //
+
1494 {-0.984955609, -0.490281343}, //
+
1495 {-0.985008538, -0.489676297}, //
+
1496 {-0.98491329, -0.491925418}, //
+
1497 {-0.984878719, -0.492937535}, //
+
1498 });
+
1499 TestPoly(polys, 5, 0.0001);
+
1500};
+
1501
+
1502TEST(Polygon, Precision2) {
+
1503 Polygons polys;
+
1504 polys.push_back({
+
1505 {4.98093176, -0.2479388121113}, //
+
1506 {4.94630527, -0.08263990282736}, //
+
1507 {4.98092985, -0.2479388122735}, //
+
1508 });
+
1509 polys.push_back({
+
1510 {4.76215458, -0.2478484367566}, //
+
1511 {4.76215267, -0.2478604172640}, //
+
1512 {4.76215553, -0.2478604172639}, //
+
1513 });
+
1514 polys.push_back({
+
1515 {4.95041943, -0.2417418967815}, //
+
1516 {4.85906506, -0.2231211817816}, //
+
1517 {4.90268326, -0.1528855567824}, //
+
1518 {4.82208872, -0.185909457823}, //
+
1519 {4.79133606, -0.2478708772638}, //
+
1520 {4.98092985, -0.2479388122733}, //
+
1521 {4.90268326, -0.1528855567822}, //
+
1522 {4.95041943, -0.2417418967819}, //
+
1523 });
+
1524 TestPoly(polys, 8);
+
1525};
+
1526
+
1527TEST(Polygon, Precision3) {
+
1528 Polygons polys;
+
1529 polys.push_back({
+
1530 {0.630340576, 1.6097908}, //
+
1531 {0.777489543, 1.58760202}, //
+
1532 {0.890084028, 1.60028839}, //
+
1533 {1.05917394, 1.65945554}, //
+
1534 {1.06027794, 1.65984178}, //
+
1535 });
+
1536 TestPoly(polys, 3, 0.00068);
+
1537};
+
1538
+
1539TEST(Polygon, DegenerateRing) {
+
1540 Polygons polys;
+
1541 polys.push_back({
+
1542 {-9.82835007, -8.06539154}, //
+
1543 {-10.1291866, -7.88505363}, //
+
1544 {-10.1291866, -8.2457304}, //
+
1545 });
+
1546 polys.push_back({
+
1547 {-9.82835007, -8.06539154}, //
+
1548 {-9.82835007, -8.06539154}, //
+
1549 {-9.82835007, -8.06539154}, //
+
1550 {-10.1291866, -8.24572945}, //
+
1551 {-10.1291866, -7.88505363}, //
+
1552 {-9.82835007, -8.06539154}, //
+
1553 });
+
1554 TestPoly(polys, 9);
+
1555}
+
1556
+
1557TEST(Polygon, Sweep) {
+
1558 Polygons polys;
+
1559 polys.push_back({
+
1560 {0, 0.637057483}, //
+
1561 {0, 0.637057483}, //
+
1562 {1.72745752, 4.72425699}, //
+
1563 {1.72745752, 4.72425699}, //
+
1564 {1.72745752, 4.72425699}, //
+
1565 {1.7274611, 4.72425747}, //
+
1566 {0, 0.637057483}, //
+
1567 {2.5, 4.82678747}, //
+
1568 {1.72745752, 4.72425747}, //
+
1569 {0, 0.637057483}, //
+
1570 {0, 0.637057483}, //
+
1571 {0, 0.637057483}, //
+
1572 {0, 0.637057483}, //
+
1573 {0, 0.637057483}, //
+
1574 });
+
1575 TestPoly(polys, 12);
+
1576}
+
1577
+
1578TEST(Polygon, Hole) {
+
1579 Polygons polys;
+
1580 polys.push_back({
+
1581 {0.5, -0.5}, //
+
1582 {0.5, 0.5}, //
+
1583 {-0.5, 0.5}, //
+
1584 {-0.5, 0.5}, //
+
1585 {-0.5, 0.5}, //
+
1586 {-0, 0.5}, //
+
1587 {-0.25, 0.25}, //
+
1588 {0.25, -0.25}, //
+
1589 {0.5, 0}, //
+
1590 {0.5, 0}, //
+
1591 {0.5, -0.5}, //
+
1592 {0.5, -0.5}, //
+
1593 {0.5, -0.5}, //
+
1594 });
+
1595 polys.push_back({
+
1596 {0.5, 0}, //
+
1597 {-0, 0.5}, //
+
1598 {-0, 0.5}, //
+
1599 {0.5, 0.5}, //
+
1600 {0.5, 0.5}, //
+
1601 {0.5, 0.5}, //
+
1602 });
+
1603 TestPoly(polys, 19);
+
1604}
+
1605
+
1606TEST(Polygon, Hole2) {
+
1607 Polygons polys;
+
1608 polys.push_back({
+
1609 {0, -21.8057232}, //
+
1610 {0.142438874, -21.3274956}, //
+
1611 {0.118176684, -21.1638756}, //
+
1612 {2.24720502, -20.7749138}, //
+
1613 {0.0947285369, -20.7749138}, //
+
1614 {0.0428545363, -19.7292175}, //
+
1615 });
+
1616 polys.push_back({
+
1617 {0.094730109, -20.7749138}, //
+
1618 {1.17382383, -20.7749138}, //
+
1619 {0.118176684, -21.1638756}, //
+
1620 });
+
1621 TestPoly(polys, 9);
+
1622}
+
1623
+
1624TEST(Polygon, Hole3) {
+
1625 Polygons polys;
+
1626 polys.push_back({
+
1627 {9.42795753, 9.36543179}, //
+
1628 {9.41050148, 9.39931583}, //
+
1629 {9.39856625, 9.36543179}, //
+
1630 });
+
1631 polys.push_back({
+
1632 {9.3985672, 9.36543179}, //
+
1633 {9.39856625, 9.36543179}, //
+
1634 {9.39856625, 9.36543179}, //
+
1635 {9.39856625, 9.36543274}, //
+
1636 {9.41050148, 9.39931488}, //
+
1637 {9.41945648, 9.38193321}, //
+
1638 {9.41326141, 9.36543179}, //
+
1639 });
+
1640 TestPoly(polys, 10);
+
1641}
+
1642
+
1643TEST(Polygon, Separate3) {
+
1644 Polygons polys;
+
1645 polys.push_back({
+
1646 {-3.46249032, 0}, //
+
1647 {-3.46249056, 4.95030928}, //
+
1648 {-3.93332648, 1.35438299}, //
+
1649 });
+
1650 polys.push_back({
+
1651 {-5.15814781, 4.8776412}, //
+
1652 {-5.11540651, 4.75469398}, //
+
1653 {-5.11540651, 4.87985134}, //
+
1654 {-5.11540651, 4.87985849}, //
+
1655 });
+
1656 polys.push_back({
+
1657 {-4.29695415, 4.92231846}, //
+
1658 {-4.47298813, 2.90674615}, //
+
1659 {-4.37842369, 2.634727}, //
+
1660 {-4.29695415, 4.92231846}, //
+
1661 {-4.29695415, 4.92231846}, //
+
1662 {-5.03241968, 4.88416386}, //
+
1663 {-5.03241968, 4.51597786}, //
+
1664 {-5.03241968, 4.51597786}, //
+
1665 });
+
1666 TestPoly(polys, 9);
+
1667}
+
1668
+
1669TEST(Polygon, Small) {
+
1670 Polygons polys;
+
1671 polys.push_back({
+
1672 {-0.487163663, 0.00357927009}, //
+
1673 {-0.49125129, 0.244737789}, //
+
1674 {-0.491251856, 0.24427411}, //
+
1675 {-0.491260529, 0.245025411}, //
+
1676 {-0.49067378, 6.32605588e-05}, //
+
1677 });
+
1678 TestPoly(polys, 3, 0.0001);
+
1679};
+
1680
+
1681TEST(Polygon, Comb) {
+
1682 Polygons polys;
+
1683 polys.push_back({
+
1684 {0.462962955, -0.4272976528}, //
+
1685 {0.5, -0.425925917}, //
+
1686 {-0.5, -0.42592591283}, //
+
1687 {-0.5, -0.462962955269}, //
+
1688 {-0.462962985, -0.461591214268}, //
+
1689 {-0.462962985, -0.42592591282}, //
+
1690 {-0.42592594, -0.42592591280}, //
+
1691 {-0.42592594, -0.460219473266}, //
+
1692 {-0.351851881, -0.45747599247}, //
+
1693 {-0.351851881, -0.42592591257}, //
+
1694 {-0.314814836, -0.42592591256}, //
+
1695 {-0.314814836, -0.456104249245}, //
+
1696 {-0.240740746, -0.453360766132}, //
+
1697 {-0.240740746, -0.42592591143}, //
+
1698 {-0.203703716, -0.42592591142}, //
+
1699 {-0.203703716, -0.451989025130}, //
+
1700 {-0.129629642, -0.449245542128}, //
+
1701 {-0.129629642, -0.42592591141}, //
+
1702 {-0.092592597, -0.42592591119}, //
+
1703 {-0.092592597, -0.447873801111}, //
+
1704 {-0.0185185187, -0.445130289109}, //
+
1705 {-0.0185185187, -0.42592591117}, //
+
1706 {0.0185185187, -0.4259259169}, //
+
1707 {0.0185185187, -0.44375854762}, //
+
1708 {0.0925925896, -0.44101506560}, //
+
1709 {0.0925925896, -0.4259259168}, //
+
1710 {0.129629627, -0.4259259152}, //
+
1711 {0.129629627, -0.43964332341}, //
+
1712 {0.203703731, -0.43689984150}, //
+
1713 {0.203703731, -0.4259259151}, //
+
1714 {0.240740761, -0.4259259149}, //
+
1715 {0.240740761, -0.435528148}, //
+
1716 {0.314814806, -0.4327846170}, //
+
1717 {0.314814806, -0.425925911}, //
+
1718 {0.351851851, -0.425925919}, //
+
1719 {0.351851851, -0.4314128768}, //
+
1720 {0.42592591, -0.4286693931}, //
+
1721 {0.42592591, -0.425925912}, //
+
1722 {0.462962955, -0.425925919}, //
+
1723 });
+
1724 TestPoly(polys, 37);
+
1725}
+
1726
+
1727TEST(Polygon, Comb2) {
+
1728 Polygons polys;
+
1729 polys.push_back({
+
1730 {-0.5, -0.462962955}, //
+
1731 {-0.462962955, -0.461591214}, //
+
1732 {-0.462962955, -0.425925913}, //
+
1733 {-0.42592591, -0.425925915}, //
+
1734 {-0.42592591, -0.460219473}, //
+
1735 {-0.351851851, -0.457475998}, //
+
1736 {-0.351851851, -0.425925915}, //
+
1737 {-0.314814806, -0.425925916}, //
+
1738 {-0.314814806, -0.4561042490}, //
+
1739 {-0.240740761, -0.45336076632}, //
+
1740 {-0.240740761, -0.4259259144}, //
+
1741 {-0.203703731, -0.4259259145}, //
+
1742 {-0.203703731, -0.45198902534}, //
+
1743 {-0.129629627, -0.44924554237}, //
+
1744 {-0.129629627, -0.4259259147}, //
+
1745 {-0.0925925896, -0.4259259164}, //
+
1746 {-0.0925925896, -0.44787380155}, //
+
1747 {-0.0185185187, -0.44513028958}, //
+
1748 {-0.0185185187, -0.4259259166}, //
+
1749 {0.0185185187, -0.42592591113}, //
+
1750 {0.0185185187, -0.443758547104}, //
+
1751 {0.092592597, -0.441015065107}, //
+
1752 {0.092592597, -0.42592591116}, //
+
1753 {0.129629642, -0.42592591134}, //
+
1754 {0.129629642, -0.439643323122}, //
+
1755 {0.203703716, -0.436899841137}, //
+
1756 {0.203703716, -0.42592591138}, //
+
1757 {0.240740746, -0.42592591140}, //
+
1758 {0.240740746, -0.4355281139}, //
+
1759 {0.314814836, -0.432784617251}, //
+
1760 {0.314814836, -0.42592591252}, //
+
1761 {0.351851881, -0.42592591254}, //
+
1762 {0.351851881, -0.431412876253}, //
+
1763 {0.42592594, -0.428669393272}, //
+
1764 {0.42592594, -0.42592591273}, //
+
1765 {0.462962985, -0.42592591278}, //
+
1766 {0.462962985, -0.427297652277}, //
+
1767 {0.5, -0.42592591279}, //
+
1768 {-0.5, -0.425925912}, //
+
1769 });
+
1770 TestPoly(polys, 37);
+
1771}
+
1772
+
1773TEST(Polygon, PointPoly) {
+
1774 Polygons polys;
+
1775 polys.push_back({
+
1776 {0, -15.97809792}, //
+
1777 {5.08144999, -14.267872844}, //
+
1778 {4.83870935, -14.078962343}, //
+
1779 {4.38336992, -13.749200837}, //
+
1780 {4.35483837, -13.728474638}, //
+
1781 {4.33122683, -13.71277935}, //
+
1782 {3.87096763, -13.368933730}, //
+
1783 {3.52637458, -13.13335511}, //
+
1784 {3.38709664, -13.02511889}, //
+
1785 {3.10755324, -12.82632165}, //
+
1786 {2.90322566, -12.68068413}, //
+
1787 {2.80962205, -12.62084011}, //
+
1788 {2.41935468, -12.32800489}, //
+
1789 {2.16151524, -12.15446578}, //
+
1790 {1.93548381, -11.97346316}, //
+
1791 {1.56781006, -11.70936397}, //
+
1792 {1.45161283, -11.60849956}, //
+
1793 {1.02412188, -11.27564533}, //
+
1794 {0.967741907, -11.22161294}, //
+
1795 {0.628127813, -10.92966180}, //
+
1796 {0, -10.92966183}, //
+
1797 });
+
1798 polys.push_back({
+
1799 {15, -10.9296618052}, //
+
1800 {15, -10.9296618051}, //
+
1801 {15, -10.9296618053}, //
+
1802 });
+
1803 TestPoly(polys, 20);
+
1804};
+
1805
+
1806TEST(Polygon, KissingZigzag) {
+
1807 Polygons polys;
+
1808 polys.push_back({
+
1809 {37.4667358, 0}, //
+
1810 {27.8904877, -3.04520559}, //
+
1811 {27.8904877, 3.04520559}, //
+
1812 {37.4667358, 0}, //
+
1813 {36.4568138, 8.64042377}, //
+
1814 {27.8409691, 3.46886754}, //
+
1815 {26.4364243, 9.39511108}, //
+
1816 {36.4568138, 8.64042377}, //
+
1817 {33.4814987, 16.8150406}, //
+
1818 {26.2905369, 9.79593277}, //
+
1819 {23.5571651, 15.23852350}, //
+
1820 {33.4814987, 16.81504061}, //
+
1821 {28.7011852, 24.08315282}, //
+
1822 {23.322773, 15.59489543}, //
+
1823 {19.4079323, 20.26042184}, //
+
1824 {28.7011852, 24.08315285}, //
+
1825 {22.3735847, 30.05293856}, //
+
1826 {19.0976753, 20.55313687}, //
+
1827 {14.2124147, 24.19007688}, //
+
1828 {22.3735847, 30.05293859}, //
+
1829 {14.8398142, 34.40256120}, //
+
1830 {13.8430138, 24.40335081}, //
+
1831 {8.2507, 26.81563952}, //
+
1832 {14.8398142, 34.40256123}, //
+
1833 {6.50603199, 36.89752964}, //
+
1834 {7.84207535, 26.9379735}, //
+
1835 {1.84419155, 27.99556356}, //
+
1836 {6.50603199, 36.89752967}, //
+
1837 {-2.1784966, 37.40335088}, //
+
1838 {1.41836619, 28.02036489}, //
+
1839 {-4.66174126, 27.66623880}, //
+
1840 {-2.1784966, 37.40335081}, //
+
1841 {-10.7455816, 35.89273832}, //
+
1842 {-5.08180761, 27.59216883}, //
+
1843 {-10.916357, 25.84541894}, //
+
1844 {-10.7455816, 35.89273835}, //
+
1845 {-18.7333698, 32.44714366}, //
+
1846 {-11.3080206, 25.67647177}, //
+
1847 {-16.5824718, 22.63126758}, //
+
1848 {-18.7333698, 32.44714369}, //
+
1849 {-25.711235, 27.25231360}, //
+
1850 {-16.924614, 22.37655071}, //
+
1851 {-21.3546181, 18.19705772}, //
+
1852 {-25.711235, 27.25231363}, //
+
1853 {-31.3030052, 20.58830454}, //
+
1854 {-21.6287994, 17.87030415}, //
+
1855 {-24.9755325, 12.78183846}, //
+
1856 {-31.3030052, 20.58830457}, //
+
1857 {-35.2072144, 12.81438068}, //
+
1858 {-25.1669636, 12.40066729}, //
+
1859 {-27.2500057, 6.677553180}, //
+
1860 {-35.2072144, 12.81438061}, //
+
1861 {-37.213398, 4.349624632}, //
+
1862 {-27.3483734, 6.262504583}, //
+
1863 {-28.0554276, 0.2132747174}, //
+
1864 {-37.213398, 4.349624635}, //
+
1865 {-37.213398, -4.349621776}, //
+
1866 {-28.0554276, -0.213272817}, //
+
1867 {-27.3483734, -6.262502678}, //
+
1868 {-37.213398, -4.349621779}, //
+
1869 {-35.2072144, -12.81437870}, //
+
1870 {-27.2500057, -6.677552221}, //
+
1871 {-25.1669636, -12.40066622}, //
+
1872 {-35.2072144, -12.81437873}, //
+
1873 {-31.3029995, -20.58831024}, //
+
1874 {-24.9755306, -12.78184325}, //
+
1875 {-21.6287937, -17.87030796}, //
+
1876 {-31.3029995, -20.58831027}, //
+
1877 {-25.7112312, -27.25231938}, //
+
1878 {-21.3546143, -18.19706159}, //
+
1879 {-16.9246101, -22.37655450}, //
+
1880 {-25.7112312, -27.25231931}, //
+
1881 {-18.7333641, -32.44714742}, //
+
1882 {-16.5824661, -22.63126953}, //
+
1883 {-11.3080158, -25.67647364}, //
+
1884 {-18.7333641, -32.44714745}, //
+
1885 {-10.7455835, -35.89273836}, //
+
1886 {-10.9163589, -25.84541897}, //
+
1887 {-5.08180904, -27.59216888}, //
+
1888 {-10.7455835, -35.89273839}, //
+
1889 {-2.17849016, -37.40335080}, //
+
1890 {-4.66173601, -27.66623881}, //
+
1891 {1.41837108, -28.02036482}, //
+
1892 {-2.17849016, -37.40335083}, //
+
1893 {6.50602913, -36.89752964}, //
+
1894 {1.84418964, -27.99556355}, //
+
1895 {7.84207344, -26.9379736}, //
+
1896 {6.50602913, -36.89752967}, //
+
1897 {14.8398247, -34.40255748}, //
+
1898 {8.25070763, -26.81563579}, //
+
1899 {13.8430195, -24.4033470}, //
+
1900 {14.8398247, -34.40255741}, //
+
1901 {22.3735847, -30.05293852}, //
+
1902 {14.2124147, -24.19007683}, //
+
1903 {19.0976753, -20.55313684}, //
+
1904 {22.3735847, -30.05293855}, //
+
1905 {28.7011795, -24.08315856}, //
+
1906 {19.4079285, -20.26042567}, //
+
1907 {23.3227692, -15.59490118}, //
+
1908 {28.7011795, -24.08315859}, //
+
1909 {33.4815025, -16.815036800}, //
+
1910 {23.5571671, -15.238520601}, //
+
1911 {26.2905388, -9.7959299102}, //
+
1912 {33.4815025, -16.815036803}, //
+
1913 {36.4568138, -8.6404275904}, //
+
1914 {26.4364243, -9.3951129905}, //
+
1915 {27.8409691, -3.4688699206}, //
+
1916 {36.4568138, -8.6404275907}, //
+
1917 });
+
1918 TestPoly(polys, 106);
+
1919}
+
1920
+
1921TEST(Polygon, Sponge) {
+
1922 Polygons polys;
+
1923 polys.push_back({
+
1924 {-0.5, -0.5}, //
+
1925 {-0.388888896, -0.3888888963}, //
+
1926 {-0.388888896, -0.3888888964}, //
+
1927 {-0.388888896, -0.2777777916}, //
+
1928 {-0.388888896, -0.2777777917}, //
+
1929 {-0.277777791, -0.2777777910}, //
+
1930 {-0.166666657, -0.1666666721}, //
+
1931 {-0.166666672, -0.1666666722}, //
+
1932 {-0.166666672, -0.1666666723}, //
+
1933 {-0.166666672, 0.1666666726}, //
+
1934 {-0.166666672, 0.1666666727}, //
+
1935 {0.166666657, 0.16666667242}, //
+
1936 {0.277777791, 0.27777779153}, //
+
1937 {0.277777791, 0.27777779154}, //
+
1938 {0.277777791, 0.27777779155}, //
+
1939 {0.277777791, 0.38888889656}, //
+
1940 {0.277777791, 0.38888889657}, //
+
1941 {0.388888896, 0.38888889661}, //
+
1942 {0.388888896, 0.38888889660}, //
+
1943 {0.5, 0.5}, //
+
1944 {-0.5, 0.5}, //
+
1945 });
+
1946 polys.push_back({
+
1947 {-0.388888896, -0.0555555563}, //
+
1948 {-0.388888896, -0.0555555564}, //
+
1949 {-0.388888896, 0.0555555563}, //
+
1950 {-0.388888896, 0.0555555564}, //
+
1951 {-0.277777791, 0.0555555566}, //
+
1952 {-0.277777791, 0.0555555565}, //
+
1953 {-0.277777791, -0.0555555565}, //
+
1954 {-0.277777791, -0.0555555566}, //
+
1955 });
+
1956 polys.push_back({
+
1957 {-0.277777791, 0.2777777912}, //
+
1958 {-0.277777791, 0.2777777913}, //
+
1959 {-0.388888896, 0.2777777917}, //
+
1960 {-0.388888896, 0.2777777918}, //
+
1961 {-0.388888896, 0.3888888960}, //
+
1962 {-0.388888896, 0.3888888961}, //
+
1963 {-0.277777791, 0.3888888964}, //
+
1964 {-0.277777791, 0.3888888965}, //
+
1965 });
+
1966 polys.push_back({
+
1967 {-0.055555556, 0.2777777918}, //
+
1968 {-0.055555556, 0.2777777919}, //
+
1969 {-0.055555556, 0.3888888960}, //
+
1970 {-0.055555556, 0.3888888961}, //
+
1971 {0.055555556, 0.38888889647}, //
+
1972 {0.055555556, 0.38888889648}, //
+
1973 {0.055555556, 0.27777779146}, //
+
1974 {0.055555556, 0.27777779145}, //
+
1975 });
+
1976 TestPoly(polys, 49);
+
1977}
+
1978
+
1979TEST(Polygon, Sponge2) {
+
1980 Polygons polys;
+
1981 polys.push_back({
+
1982 {0.5, -0.5}, //
+
1983 {0.5, 0.5}, //
+
1984 {-0.5, 0.5}, //
+
1985 {-0.388888896, 0.388888896}, //
+
1986 {-0.388888896, 0.388888896}, //
+
1987 {-0.277777791, 0.388888896}, //
+
1988 {-0.277777791, 0.388888896}, //
+
1989 {-0.277777791, 0.388888896}, //
+
1990 {-0.277777791, 0.277777791}, //
+
1991 {-0.277777791, 0.277777791}, //
+
1992 {-0.166666657, 0.166666672}, //
+
1993 {-0.166666657, 0.166666672}, //
+
1994 {0.166666672, 0.166666672}, //
+
1995 {0.166666672, 0.166666672}, //
+
1996 {0.166666672, 0.166666672}, //
+
1997 {0.166666672, 0.166666672}, //
+
1998 {0.166666672, 0.166666672}, //
+
1999 {0.166666672, -0.166666672}, //
+
2000 {0.166666672, -0.166666672}, //
+
2001 {0.166666672, -0.166666672}, //
+
2002 {0.166666672, -0.166666672}, //
+
2003 {0.166666657, -0.166666672}, //
+
2004 {0.277777791, -0.277777791}, //
+
2005 {0.388888896, -0.277777791}, //
+
2006 {0.388888896, -0.277777791}, //
+
2007 {0.388888896, -0.277777791}, //
+
2008 {0.388888896, -0.388888896}, //
+
2009 });
+
2010 polys.push_back({
+
2011 {0.388888896, -0.055555556}, //
+
2012 {0.277777791, -0.055555556}, //
+
2013 {0.277777791, -0.055555556}, //
+
2014 {0.277777791, -0.055555556}, //
+
2015 {0.277777791, 0.055555556}, //
+
2016 {0.388888896, 0.055555556}, //
+
2017 {0.388888896, 0.055555556}, //
+
2018 {0.388888896, 0.055555556}, //
+
2019 });
+
2020 polys.push_back({
+
2021 {0.388888896, 0.277777791}, //
+
2022 {0.277777791, 0.277777791}, //
+
2023 {0.277777791, 0.277777791}, //
+
2024 {0.277777791, 0.277777791}, //
+
2025 {0.277777791, 0.388888896}, //
+
2026 {0.388888896, 0.388888896}, //
+
2027 {0.388888896, 0.388888896}, //
+
2028 {0.388888896, 0.388888896}, //
+
2029 });
+
2030 polys.push_back({
+
2031 {0.055555556, 0.277777791}, //
+
2032 {0.055555556, 0.277777791}, //
+
2033 {-0.055555556, 0.277777791}, //
+
2034 {-0.055555556, 0.277777791}, //
+
2035 {-0.055555556, 0.388888896}, //
+
2036 {-0.055555556, 0.388888896}, //
+
2037 {0.055555556, 0.388888896}, //
+
2038 {0.055555556, 0.388888896}, //
+
2039 });
+
2040 TestPoly(polys, 55);
+
2041}
+
2042
+
2043TEST(Polygon, SquareHoles) {
+
2044 Polygons polys;
+
2045 polys.push_back({
+
2046 {0.388888896, -0.2777777910}, //
+
2047 {0.388888896, -0.388888896}, //
+
2048 {0.277777791, -0.388888896}, //
+
2049 {0.277777791, -0.2777777911}, //
+
2050 });
+
2051 polys.push_back({
+
2052 {0.388888896, -0.0555555564}, //
+
2053 {0.277777791, -0.0555555562}, //
+
2054 {0.277777791, 0.0555555566}, //
+
2055 {0.388888896, 0.0555555565}, //
+
2056 });
+
2057 polys.push_back({
+
2058 {0.055555556, -0.2777777915}, //
+
2059 {0.055555556, -0.3888888963}, //
+
2060 {-0.055555556, -0.3888888963}, //
+
2061 {-0.055555556, -0.2777777914}, //
+
2062 });
+
2063 polys.push_back({
+
2064 {0.388888896, 0.2777777918}, //
+
2065 {0.277777791, 0.2777777917}, //
+
2066 {0.277777791, 0.3888888960}, //
+
2067 {0.388888896, 0.3888888969}, //
+
2068 });
+
2069 polys.push_back({
+
2070 {0.166666672, 0.1666666722}, //
+
2071 {0.166666672, -0.1666666721}, //
+
2072 {-0.166666672, -0.1666666726}, //
+
2073 {-0.166666672, 0.1666666723}, //
+
2074 });
+
2075 polys.push_back({
+
2076 {0.055555556, 0.3888888965}, //
+
2077 {0.055555556, 0.2777777912}, //
+
2078 {-0.055555556, 0.2777777914}, //
+
2079 {-0.055555556, 0.3888888966}, //
+
2080 });
+
2081 polys.push_back({
+
2082 {-0.277777791, -0.2777777910}, //
+
2083 {-0.277777791, -0.3888888967}, //
+
2084 {-0.388888896, -0.3888888968}, //
+
2085 {-0.388888896, -0.2777777919}, //
+
2086 });
+
2087 polys.push_back({
+
2088 {-0.277777791, -0.0555555567}, //
+
2089 {-0.388888896, -0.0555555561}, //
+
2090 {-0.388888896, 0.0555555569}, //
+
2091 {-0.277777791, 0.0555555568}, //
+
2092 });
+
2093 polys.push_back({
+
2094 {-0.277777791, 0.3888888962}, //
+
2095 {-0.277777791, 0.2777777910}, //
+
2096 {-0.388888896, 0.2777777911}, //
+
2097 {-0.388888896, 0.3888888963}, //
+
2098 });
+
2099 polys.push_back({
+
2100 {-0.5, -0.5}, //
+
2101 {0.5, -0.5}, //
+
2102 {0.5, 0.5}, //
+
2103 {-0.5, 0.5}, //
+
2104 });
+
2105 TestPoly(polys, 56);
+
2106}
+
2107
+
2108TEST(Polygon, Sponge3) {
+
2109 Polygons polys;
+
2110 polys.push_back({
+
2111 {0.5, -0.166666672}, //
+
2112 {0.351851851, -0.117283955}, //
+
2113 {0.351851851, -0.129629627}, //
+
2114 {0.339506179, -0.129629627}, //
+
2115 {0.314814836, -0.129629627}, //
+
2116 {0.314814836, -0.117283948}, //
+
2117 {0.314814836, -0.104938276}, //
+
2118 {0.166666672, -0.0555555597}, //
+
2119 {0.166666672, -0.166666672}, //
+
2120 {0.0555555634, -0.166666672}, //
+
2121 {-0.166666672, -0.166666672}, //
+
2122 {-0.166666672, -0.0555555634}, //
+
2123 {-0.166666672, 0.0555555597}, //
+
2124 {-0.314814836, 0.104938276}, //
+
2125 {-0.314814836, 0.092592597}, //
+
2126 {-0.327160507, 0.092592597}, //
+
2127 {-0.351851851, 0.092592597}, //
+
2128 {-0.351851851, 0.104938276}, //
+
2129 {-0.351851851, 0.117283955}, //
+
2130 {-0.5, 0.166666672}, //
+
2131 {-0.5, -0.166666672}, //
+
2132 });
+
2133 polys.push_back({
+
2134 {0.240740761, -0.092592597}, //
+
2135 {0.240740761, -0.104938276}, //
+
2136 {0.240740761, -0.129629627}, //
+
2137 {0.228395075, -0.129629627}, //
+
2138 {0.203703716, -0.129629627}, //
+
2139 {0.203703716, -0.117283948}, //
+
2140 {0.203703716, -0.092592597}, //
+
2141 {0.216049403, -0.092592597}, //
+
2142 });
+
2143 polys.push_back({
+
2144 {-0.203703716, -0.129629627}, //
+
2145 {-0.216049403, -0.129629627}, //
+
2146 {-0.240740761, -0.129629627}, //
+
2147 {-0.240740761, -0.117283948}, //
+
2148 {-0.240740761, -0.092592597}, //
+
2149 {-0.228395075, -0.092592597}, //
+
2150 {-0.203703716, -0.092592597}, //
+
2151 {-0.203703716, -0.104938276}, //
+
2152 });
+
2153 polys.push_back({
+
2154 {-0.203703716, -0.0185185187}, //
+
2155 {-0.216049403, -0.0185185187}, //
+
2156 {-0.240740761, -0.0185185187}, //
+
2157 {-0.240740761, -0.00617284048}, //
+
2158 {-0.240740761, 0.0185185187}, //
+
2159 {-0.228395075, 0.0185185187}, //
+
2160 {-0.203703716, 0.0185185187}, //
+
2161 {-0.203703716, 0.00617284048}, //
+
2162 });
+
2163 polys.push_back({
+
2164 {-0.314814836, -0.129629627}, //
+
2165 {-0.327160507, -0.129629627}, //
+
2166 {-0.351851851, -0.129629627}, //
+
2167 {-0.351851851, -0.117283948}, //
+
2168 {-0.351851851, -0.092592597}, //
+
2169 {-0.339506179, -0.092592597}, //
+
2170 {-0.314814836, -0.092592597}, //
+
2171 {-0.314814836, -0.104938276}, //
+
2172 });
+
2173 polys.push_back({
+
2174 {-0.42592594, -0.129629627}, //
+
2175 {-0.438271612, -0.129629627}, //
+
2176 {-0.462962955, -0.129629627}, //
+
2177 {-0.462962955, -0.117283948}, //
+
2178 {-0.462962955, -0.092592597}, //
+
2179 {-0.450617284, -0.092592597}, //
+
2180 {-0.42592594, -0.092592597}, //
+
2181 {-0.42592594, -0.104938276}, //
+
2182 });
+
2183 polys.push_back({
+
2184 {-0.277777791, -0.055555556}, //
+
2185 {-0.314814836, -0.055555556}, //
+
2186 {-0.388888896, -0.055555556}, //
+
2187 {-0.388888896, -0.0185185205}, //
+
2188 {-0.388888896, 0.055555556}, //
+
2189 {-0.351851851, 0.055555556}, //
+
2190 {-0.277777791, 0.055555556}, //
+
2191 {-0.277777791, 0.0185185205}, //
+
2192 });
+
2193 polys.push_back({
+
2194 {-0.42592594, -0.0185185187}, //
+
2195 {-0.438271612, -0.0185185187}, //
+
2196 {-0.462962955, -0.0185185187}, //
+
2197 {-0.462962955, -0.00617284048}, //
+
2198 {-0.462962955, 0.0185185187}, //
+
2199 {-0.450617284, 0.0185185187}, //
+
2200 {-0.42592594, 0.0185185187}, //
+
2201 {-0.42592594, 0.00617284048}, //
+
2202 });
+
2203 polys.push_back({
+
2204 {-0.42592594, 0.092592597}, //
+
2205 {-0.438271612, 0.092592597}, //
+
2206 {-0.462962955, 0.092592597}, //
+
2207 {-0.462962955, 0.104938276}, //
+
2208 {-0.462962955, 0.129629627}, //
+
2209 {-0.450617284, 0.129629627}, //
+
2210 {-0.42592594, 0.129629627}, //
+
2211 {-0.42592594, 0.117283948}, //
+
2212 });
+
2213 TestPoly(polys, 99);
+
2214}
+
2215
+
2216TEST(Polygon, SpongeMore) {
+
2217 Polygons polys;
+
2218 polys.push_back({
+
2219 {-0.376543224, 0.0802469105}, //
+
2220 {-0.277777791, 0.277777791}, //
+
2221 {-0.388888896, 0.277777791}, //
+
2222 });
+
2223 polys.push_back({
+
2224 {-0.364197552, 0.104938269}, //
+
2225 {-0.376543224, 0.117283955}, //
+
2226 {-0.364197552, 0.117283955}, //
+
2227 });
+
2228 polys.push_back({
+
2229 {-0.364197552, 0.141975313}, //
+
2230 {-0.376543224, 0.154320985}, //
+
2231 {-0.364197552, 0.154320985}, //
+
2232 });
+
2233 polys.push_back({
+
2234 {-0.339506179, 0.19135803}, //
+
2235 {-0.327160507, 0.19135803}, //
+
2236 {-0.327160507, 0.179012358}, //
+
2237 });
+
2238 polys.push_back({
+
2239 {-0.314814836, 0.203703716}, //
+
2240 {-0.351851851, 0.240740761}, //
+
2241 {-0.314814836, 0.240740761}, //
+
2242 });
+
2243 TestPoly(polys, 21);
+
2244}
+
2245
+
2246TEST(Polygon, Sponge3a) {
+
2247 Polygons polys;
+
2248 polys.push_back({
+
2249 {0.5, -0.5}, //
+
2250 {0.462962955, -0.462962955}, //
+
2251 {0.462962955, -0.462962955}, //
+
2252 {0.42592594, -0.462962955}, //
+
2253 {0.42592594, -0.462962955}, //
+
2254 {0.42592594, -0.462962955}, //
+
2255 {0.42592594, -0.42592594}, //
+
2256 {0.42592594, -0.42592594}, //
+
2257 {0.388888896, -0.388888896}, //
+
2258 {0.388888896, -0.388888896}, //
+
2259 {0.388888896, -0.388888896}, //
+
2260 {0.388888896, -0.388888896}, //
+
2261 {0.277777791, -0.388888896}, //
+
2262 {0.277777791, -0.388888896}, //
+
2263 {0.277777791, -0.388888896}, //
+
2264 {0.277777791, -0.388888896}, //
+
2265 {0.277777791, -0.388888896}, //
+
2266 {0.277777791, -0.388888896}, //
+
2267 {0.277777791, -0.277777791}, //
+
2268 {0.277777791, -0.277777791}, //
+
2269 {0.277777791, -0.277777791}, //
+
2270 {0.277777791, -0.277777791}, //
+
2271 {0.240740746, -0.240740761}, //
+
2272 {0.203703716, -0.240740761}, //
+
2273 {0.203703716, -0.240740761}, //
+
2274 {0.203703716, -0.240740761}, //
+
2275 {0.203703716, -0.203703716}, //
+
2276 {0.203703731, -0.203703716}, //
+
2277 {0.166666657, -0.166666672}, //
+
2278 {0.166666657, -0.166666672}, //
+
2279 {0.166666657, -0.166666672}, //
+
2280 {0.166666657, -0.166666672}, //
+
2281 {0.166666657, -0.166666672}, //
+
2282 {0.166666657, -0.166666672}, //
+
2283 {-0.166666672, -0.166666672}, //
+
2284 {-0.166666672, -0.166666672}, //
+
2285 {-0.166666672, -0.166666672}, //
+
2286 {-0.166666672, -0.166666672}, //
+
2287 {-0.166666672, -0.166666672}, //
+
2288 {-0.166666672, -0.166666672}, //
+
2289 {-0.166666672, -0.166666672}, //
+
2290 {-0.166666672, -0.166666672}, //
+
2291 {-0.166666672, -0.166666672}, //
+
2292 {-0.166666672, -0.166666672}, //
+
2293 {-0.166666672, -0.166666672}, //
+
2294 {-0.166666672, -0.166666672}, //
+
2295 {-0.166666672, -0.166666672}, //
+
2296 {-0.166666672, -0.166666672}, //
+
2297 {-0.166666672, 0.166666672}, //
+
2298 {-0.166666672, 0.166666672}, //
+
2299 {-0.166666672, 0.166666672}, //
+
2300 {-0.166666672, 0.166666672}, //
+
2301 {-0.166666672, 0.166666672}, //
+
2302 {-0.166666672, 0.166666672}, //
+
2303 {-0.166666672, 0.166666672}, //
+
2304 {-0.166666672, 0.166666672}, //
+
2305 {-0.166666672, 0.166666672}, //
+
2306 {-0.166666672, 0.166666672}, //
+
2307 {-0.166666672, 0.166666672}, //
+
2308 {-0.166666672, 0.166666672}, //
+
2309 {-0.166666657, 0.166666672}, //
+
2310 {-0.203703731, 0.203703716}, //
+
2311 {-0.240740761, 0.203703716}, //
+
2312 {-0.240740761, 0.203703716}, //
+
2313 {-0.240740761, 0.203703716}, //
+
2314 {-0.240740761, 0.240740761}, //
+
2315 {-0.240740746, 0.240740761}, //
+
2316 {-0.277777791, 0.277777791}, //
+
2317 {-0.277777791, 0.277777791}, //
+
2318 {-0.277777791, 0.277777791}, //
+
2319 {-0.388888896, 0.277777791}, //
+
2320 {-0.388888896, 0.277777791}, //
+
2321 {-0.388888896, 0.277777791}, //
+
2322 {-0.388888896, 0.277777791}, //
+
2323 {-0.388888896, 0.277777791}, //
+
2324 {-0.388888896, 0.277777791}, //
+
2325 {-0.388888896, 0.388888896}, //
+
2326 {-0.388888896, 0.388888896}, //
+
2327 {-0.42592594, 0.42592594}, //
+
2328 {-0.462962955, 0.42592594}, //
+
2329 {-0.462962955, 0.42592594}, //
+
2330 {-0.462962955, 0.42592594}, //
+
2331 {-0.462962955, 0.462962955}, //
+
2332 {-0.5, 0.5}, //
+
2333 {-0.5, -0.5}, //
+
2334 });
+
2335 polys.push_back({
+
2336 {0.351851851, -0.462962955}, //
+
2337 {0.351851851, -0.462962955}, //
+
2338 {0.314814836, -0.462962955}, //
+
2339 {0.314814836, -0.462962955}, //
+
2340 {0.314814836, -0.42592594}, //
+
2341 {0.314814836, -0.42592594}, //
+
2342 {0.351851851, -0.42592594}, //
+
2343 {0.351851851, -0.42592594}, //
+
2344 });
+
2345 polys.push_back({
+
2346 {0.240740761, -0.462962955}, //
+
2347 {0.203703716, -0.462962955}, //
+
2348 {0.203703716, -0.462962955}, //
+
2349 {0.203703716, -0.462962955}, //
+
2350 {0.203703716, -0.42592594}, //
+
2351 {0.240740761, -0.42592594}, //
+
2352 {0.240740761, -0.42592594}, //
+
2353 {0.240740761, -0.42592594}, //
+
2354 });
+
2355 polys.push_back({
+
2356 {0.129629627, -0.462962955}, //
+
2357 {0.129629627, -0.462962955}, //
+
2358 {0.092592597, -0.462962955}, //
+
2359 {0.092592597, -0.462962955}, //
+
2360 {0.092592597, -0.42592594}, //
+
2361 {0.092592597, -0.42592594}, //
+
2362 {0.129629627, -0.42592594}, //
+
2363 {0.129629627, -0.42592594}, //
+
2364 });
+
2365 polys.push_back({
+
2366 {0.240740761, -0.351851851}, //
+
2367 {0.203703716, -0.351851851}, //
+
2368 {0.203703716, -0.351851851}, //
+
2369 {0.203703716, -0.351851851}, //
+
2370 {0.203703716, -0.314814836}, //
+
2371 {0.240740761, -0.314814836}, //
+
2372 {0.240740761, -0.314814836}, //
+
2373 {0.240740761, -0.314814836}, //
+
2374 });
+
2375 polys.push_back({
+
2376 {0.129629627, -0.351851851}, //
+
2377 {0.092592597, -0.351851851}, //
+
2378 {0.092592597, -0.351851851}, //
+
2379 {0.092592597, -0.314814836}, //
+
2380 {0.092592597, -0.314814836}, //
+
2381 {0.129629627, -0.314814836}, //
+
2382 {0.129629627, -0.314814836}, //
+
2383 {0.129629627, -0.351851851}, //
+
2384 });
+
2385 polys.push_back({
+
2386 {0.0185185187, -0.462962955}, //
+
2387 {0.0185185187, -0.462962955}, //
+
2388 {-0.0185185187, -0.462962955}, //
+
2389 {-0.0185185187, -0.462962955}, //
+
2390 {-0.0185185187, -0.42592594}, //
+
2391 {-0.0185185187, -0.42592594}, //
+
2392 {0.0185185187, -0.42592594}, //
+
2393 {0.0185185187, -0.42592594}, //
+
2394 });
+
2395 polys.push_back({
+
2396 {0.055555556, -0.388888896}, //
+
2397 {0.055555556, -0.388888896}, //
+
2398 {0.055555556, -0.388888896}, //
+
2399 {-0.055555556, -0.388888896}, //
+
2400 {-0.055555556, -0.388888896}, //
+
2401 {-0.055555556, -0.388888896}, //
+
2402 {-0.055555556, -0.388888896}, //
+
2403 {-0.055555556, -0.388888896}, //
+
2404 {-0.055555556, -0.388888896}, //
+
2405 {-0.055555556, -0.277777791}, //
+
2406 {-0.055555556, -0.277777791}, //
+
2407 {-0.055555556, -0.277777791}, //
+
2408 {-0.055555556, -0.277777791}, //
+
2409 {-0.055555556, -0.277777791}, //
+
2410 {-0.055555556, -0.277777791}, //
+
2411 {0.055555556, -0.277777791}, //
+
2412 {0.055555556, -0.277777791}, //
+
2413 {0.055555556, -0.277777791}, //
+
2414 {0.055555556, -0.277777791}, //
+
2415 {0.055555556, -0.277777791}, //
+
2416 {0.055555556, -0.388888896}, //
+
2417 {0.055555556, -0.388888896}, //
+
2418 {0.055555556, -0.388888896}, //
+
2419 });
+
2420 polys.push_back({
+
2421 {0.129629627, -0.240740761}, //
+
2422 {0.092592597, -0.240740761}, //
+
2423 {0.092592597, -0.240740761}, //
+
2424 {0.092592597, -0.203703716}, //
+
2425 {0.092592597, -0.203703716}, //
+
2426 {0.129629627, -0.203703716}, //
+
2427 {0.129629627, -0.203703716}, //
+
2428 {0.129629627, -0.240740761}, //
+
2429 });
+
2430 polys.push_back({
+
2431 {0.0185185187, -0.240740761}, //
+
2432 {-0.0185185187, -0.240740761}, //
+
2433 {-0.0185185187, -0.240740761}, //
+
2434 {-0.0185185187, -0.203703716}, //
+
2435 {-0.0185185187, -0.203703716}, //
+
2436 {0.0185185187, -0.203703716}, //
+
2437 {0.0185185187, -0.203703716}, //
+
2438 {0.0185185187, -0.240740761}, //
+
2439 });
+
2440 polys.push_back({
+
2441 {-0.092592597, -0.462962955}, //
+
2442 {-0.092592597, -0.462962955}, //
+
2443 {-0.129629627, -0.462962955}, //
+
2444 {-0.129629627, -0.462962955}, //
+
2445 {-0.129629627, -0.42592594}, //
+
2446 {-0.129629627, -0.42592594}, //
+
2447 {-0.092592597, -0.42592594}, //
+
2448 {-0.092592597, -0.42592594}, //
+
2449 });
+
2450 polys.push_back({
+
2451 {-0.092592597, -0.351851851}, //
+
2452 {-0.129629627, -0.351851851}, //
+
2453 {-0.129629627, -0.351851851}, //
+
2454 {-0.129629627, -0.314814836}, //
+
2455 {-0.129629627, -0.314814836}, //
+
2456 {-0.092592597, -0.314814836}, //
+
2457 {-0.092592597, -0.314814836}, //
+
2458 {-0.092592597, -0.351851851}, //
+
2459 });
+
2460 polys.push_back({
+
2461 {-0.203703716, -0.462962955}, //
+
2462 {-0.240740761, -0.462962955}, //
+
2463 {-0.240740761, -0.462962955}, //
+
2464 {-0.240740761, -0.462962955}, //
+
2465 {-0.240740761, -0.42592594}, //
+
2466 {-0.203703716, -0.42592594}, //
+
2467 {-0.203703716, -0.42592594}, //
+
2468 {-0.203703716, -0.42592594}, //
+
2469 });
+
2470 polys.push_back({
+
2471 {-0.203703716, -0.351851851}, //
+
2472 {-0.240740761, -0.351851851}, //
+
2473 {-0.240740761, -0.351851851}, //
+
2474 {-0.240740761, -0.351851851}, //
+
2475 {-0.240740761, -0.314814836}, //
+
2476 {-0.203703716, -0.314814836}, //
+
2477 {-0.203703716, -0.314814836}, //
+
2478 {-0.203703716, -0.314814836}, //
+
2479 });
+
2480 polys.push_back({
+
2481 {-0.092592597, -0.240740761}, //
+
2482 {-0.129629627, -0.240740761}, //
+
2483 {-0.129629627, -0.240740761}, //
+
2484 {-0.129629627, -0.203703716}, //
+
2485 {-0.129629627, -0.203703716}, //
+
2486 {-0.092592597, -0.203703716}, //
+
2487 {-0.092592597, -0.203703716}, //
+
2488 {-0.092592597, -0.240740761}, //
+
2489 });
+
2490 polys.push_back({
+
2491 {-0.203703716, -0.240740761}, //
+
2492 {-0.240740761, -0.240740761}, //
+
2493 {-0.240740761, -0.240740761}, //
+
2494 {-0.240740761, -0.240740761}, //
+
2495 {-0.240740761, -0.203703716}, //
+
2496 {-0.203703716, -0.203703716}, //
+
2497 {-0.203703716, -0.203703716}, //
+
2498 {-0.203703716, -0.203703716}, //
+
2499 });
+
2500 polys.push_back({
+
2501 {-0.240740761, -0.129629627}, //
+
2502 {-0.240740761, -0.129629627}, //
+
2503 {-0.240740761, -0.092592597}, //
+
2504 {-0.203703716, -0.092592597}, //
+
2505 {-0.203703716, -0.092592597}, //
+
2506 {-0.203703716, -0.092592597}, //
+
2507 {-0.203703716, -0.129629627}, //
+
2508 {-0.240740761, -0.129629627}, //
+
2509 });
+
2510 polys.push_back({
+
2511 {-0.203703716, -0.0185185187}, //
+
2512 {-0.240740761, -0.0185185187}, //
+
2513 {-0.240740761, -0.0185185187}, //
+
2514 {-0.240740761, -0.0185185187}, //
+
2515 {-0.240740761, 0.0185185187}, //
+
2516 {-0.203703716, 0.0185185187}, //
+
2517 {-0.203703716, 0.0185185187}, //
+
2518 {-0.203703716, 0.0185185187}, //
+
2519 });
+
2520 polys.push_back({
+
2521 {-0.277777791, -0.388888896}, //
+
2522 {-0.277777791, -0.388888896}, //
+
2523 {-0.277777791, -0.388888896}, //
+
2524 {-0.388888896, -0.388888896}, //
+
2525 {-0.388888896, -0.388888896}, //
+
2526 {-0.388888896, -0.388888896}, //
+
2527 {-0.388888896, -0.388888896}, //
+
2528 {-0.388888896, -0.388888896}, //
+
2529 {-0.388888896, -0.388888896}, //
+
2530 {-0.388888896, -0.388888896}, //
+
2531 {-0.388888896, -0.277777791}, //
+
2532 {-0.388888896, -0.277777791}, //
+
2533 {-0.388888896, -0.277777791}, //
+
2534 {-0.388888896, -0.277777791}, //
+
2535 {-0.277777791, -0.277777791}, //
+
2536 {-0.277777791, -0.277777791}, //
+
2537 {-0.277777791, -0.277777791}, //
+
2538 {-0.277777791, -0.277777791}, //
+
2539 {-0.277777791, -0.277777791}, //
+
2540 {-0.277777791, -0.388888896}, //
+
2541 {-0.277777791, -0.388888896}, //
+
2542 });
+
2543 polys.push_back({
+
2544 {-0.314814836, -0.462962955}, //
+
2545 {-0.314814836, -0.462962955}, //
+
2546 {-0.351851851, -0.462962955}, //
+
2547 {-0.351851851, -0.462962955}, //
+
2548 {-0.351851851, -0.42592594}, //
+
2549 {-0.351851851, -0.42592594}, //
+
2550 {-0.314814836, -0.42592594}, //
+
2551 {-0.314814836, -0.42592594}, //
+
2552 });
+
2553 polys.push_back({
+
2554 {-0.42592594, -0.462962955}, //
+
2555 {-0.462962955, -0.462962955}, //
+
2556 {-0.462962955, -0.462962955}, //
+
2557 {-0.462962955, -0.462962955}, //
+
2558 {-0.462962955, -0.42592594}, //
+
2559 {-0.42592594, -0.42592594}, //
+
2560 {-0.42592594, -0.42592594}, //
+
2561 {-0.42592594, -0.42592594}, //
+
2562 });
+
2563 polys.push_back({
+
2564 {-0.42592594, -0.351851851}, //
+
2565 {-0.462962955, -0.351851851}, //
+
2566 {-0.462962955, -0.351851851}, //
+
2567 {-0.462962955, -0.351851851}, //
+
2568 {-0.462962955, -0.314814836}, //
+
2569 {-0.42592594, -0.314814836}, //
+
2570 {-0.42592594, -0.314814836}, //
+
2571 {-0.42592594, -0.314814836}, //
+
2572 });
+
2573 polys.push_back({
+
2574 {-0.314814836, -0.240740761}, //
+
2575 {-0.351851851, -0.240740761}, //
+
2576 {-0.351851851, -0.240740761}, //
+
2577 {-0.351851851, -0.203703716}, //
+
2578 {-0.351851851, -0.203703716}, //
+
2579 {-0.314814836, -0.203703716}, //
+
2580 {-0.314814836, -0.203703716}, //
+
2581 {-0.314814836, -0.240740761}, //
+
2582 });
+
2583 polys.push_back({
+
2584 {-0.351851851, -0.129629627}, //
+
2585 {-0.351851851, -0.092592597}, //
+
2586 {-0.351851851, -0.092592597}, //
+
2587 {-0.314814836, -0.092592597}, //
+
2588 {-0.314814836, -0.092592597}, //
+
2589 {-0.314814836, -0.129629627}, //
+
2590 {-0.314814836, -0.129629627}, //
+
2591 {-0.351851851, -0.129629627}, //
+
2592 });
+
2593 polys.push_back({
+
2594 {-0.277777791, -0.055555556}, //
+
2595 {-0.277777791, -0.055555556}, //
+
2596 {-0.277777791, -0.055555556}, //
+
2597 {-0.277777791, -0.055555556}, //
+
2598 {-0.388888896, -0.055555556}, //
+
2599 {-0.388888896, -0.055555556}, //
+
2600 {-0.388888896, -0.055555556}, //
+
2601 {-0.388888896, -0.055555556}, //
+
2602 {-0.388888896, -0.055555556}, //
+
2603 {-0.388888896, -0.055555556}, //
+
2604 {-0.388888896, 0.055555556}, //
+
2605 {-0.388888896, 0.055555556}, //
+
2606 {-0.388888896, 0.055555556}, //
+
2607 {-0.388888896, 0.055555556}, //
+
2608 {-0.388888896, 0.055555556}, //
+
2609 {-0.277777791, 0.055555556}, //
+
2610 {-0.277777791, 0.055555556}, //
+
2611 {-0.277777791, 0.055555556}, //
+
2612 {-0.277777791, 0.055555556}, //
+
2613 {-0.277777791, -0.055555556}, //
+
2614 {-0.277777791, -0.055555556}, //
+
2615 });
+
2616 polys.push_back({
+
2617 {-0.42592594, -0.240740761}, //
+
2618 {-0.462962955, -0.240740761}, //
+
2619 {-0.462962955, -0.240740761}, //
+
2620 {-0.462962955, -0.240740761}, //
+
2621 {-0.462962955, -0.203703716}, //
+
2622 {-0.42592594, -0.203703716}, //
+
2623 {-0.42592594, -0.203703716}, //
+
2624 {-0.42592594, -0.203703716}, //
+
2625 });
+
2626 polys.push_back({
+
2627 {-0.462962955, -0.129629627}, //
+
2628 {-0.462962955, -0.129629627}, //
+
2629 {-0.462962955, -0.092592597}, //
+
2630 {-0.42592594, -0.092592597}, //
+
2631 {-0.42592594, -0.092592597}, //
+
2632 {-0.42592594, -0.092592597}, //
+
2633 {-0.42592594, -0.129629627}, //
+
2634 {-0.462962955, -0.129629627}, //
+
2635 });
+
2636 polys.push_back({
+
2637 {-0.42592594, -0.0185185187}, //
+
2638 {-0.462962955, -0.0185185187}, //
+
2639 {-0.462962955, -0.0185185187}, //
+
2640 {-0.462962955, -0.0185185187}, //
+
2641 {-0.462962955, 0.0185185187}, //
+
2642 {-0.42592594, 0.0185185187}, //
+
2643 {-0.42592594, 0.0185185187}, //
+
2644 {-0.42592594, 0.0185185187}, //
+
2645 });
+
2646 polys.push_back({
+
2647 {-0.203703716, 0.092592597}, //
+
2648 {-0.240740761, 0.092592597}, //
+
2649 {-0.240740761, 0.092592597}, //
+
2650 {-0.240740761, 0.092592597}, //
+
2651 {-0.240740761, 0.129629627}, //
+
2652 {-0.203703716, 0.129629627}, //
+
2653 {-0.203703716, 0.129629627}, //
+
2654 {-0.203703716, 0.129629627}, //
+
2655 });
+
2656 polys.push_back({
+
2657 {-0.351851851, 0.092592597}, //
+
2658 {-0.351851851, 0.129629627}, //
+
2659 {-0.351851851, 0.129629627}, //
+
2660 {-0.314814836, 0.129629627}, //
+
2661 {-0.314814836, 0.129629627}, //
+
2662 {-0.314814836, 0.092592597}, //
+
2663 {-0.314814836, 0.092592597}, //
+
2664 {-0.351851851, 0.092592597}, //
+
2665 });
+
2666 polys.push_back({
+
2667 {-0.314814836, 0.203703716}, //
+
2668 {-0.351851851, 0.203703716}, //
+
2669 {-0.351851851, 0.203703716}, //
+
2670 {-0.351851851, 0.240740761}, //
+
2671 {-0.351851851, 0.240740761}, //
+
2672 {-0.314814836, 0.240740761}, //
+
2673 {-0.314814836, 0.240740761}, //
+
2674 {-0.314814836, 0.203703716}, //
+
2675 });
+
2676 polys.push_back({
+
2677 {-0.42592594, 0.092592597}, //
+
2678 {-0.462962955, 0.092592597}, //
+
2679 {-0.462962955, 0.092592597}, //
+
2680 {-0.462962955, 0.092592597}, //
+
2681 {-0.462962955, 0.129629627}, //
+
2682 {-0.42592594, 0.129629627}, //
+
2683 {-0.42592594, 0.129629627}, //
+
2684 {-0.42592594, 0.129629627}, //
+
2685 });
+
2686 polys.push_back({
+
2687 {-0.42592594, 0.203703716}, //
+
2688 {-0.462962955, 0.203703716}, //
+
2689 {-0.462962955, 0.203703716}, //
+
2690 {-0.462962955, 0.203703716}, //
+
2691 {-0.462962955, 0.240740761}, //
+
2692 {-0.42592594, 0.240740761}, //
+
2693 {-0.42592594, 0.240740761}, //
+
2694 {-0.42592594, 0.240740761}, //
+
2695 });
+
2696 polys.push_back({
+
2697 {-0.42592594, 0.314814836}, //
+
2698 {-0.462962955, 0.314814836}, //
+
2699 {-0.462962955, 0.314814836}, //
+
2700 {-0.462962955, 0.314814836}, //
+
2701 {-0.462962955, 0.351851851}, //
+
2702 {-0.42592594, 0.351851851}, //
+
2703 {-0.42592594, 0.351851851}, //
+
2704 {-0.42592594, 0.351851851}, //
+
2705 });
+
2706 TestPoly(polys, 454);
+
2707}
+
2708
+
2709TEST(Polygon, Sponge4) {
+
2710 Polygons polys;
+
2711 polys.push_back({
+
2712 {0.166666672, 0.166666672}, //
+
2713 {0.166666672, 0.5}, //
+
2714 {0.150205776, 0.450617284}, //
+
2715 {0.154320985, 0.450617284}, //
+
2716 {0.154320985, 0.44650206}, //
+
2717 {0.154320985, 0.438271612}, //
+
2718 {0.150205761, 0.438271612}, //
+
2719 {0.146090552, 0.438271612}, //
+
2720 {0.117283955, 0.351851851}, //
+
2721 {0.129629627, 0.351851851}, //
+
2722 {0.129629627, 0.339506179}, //
+
2723 {0.129629627, 0.314814836}, //
+
2724 {0.117283948, 0.314814836}, //
+
2725 {0.104938284, 0.314814836}, //
+
2726 {0.076131694, 0.228395075}, //
+
2727 {0.0802469105, 0.228395075}, //
+
2728 {0.0802469105, 0.224279851}, //
+
2729 {0.0802469105, 0.216049403}, //
+
2730 {0.0761316866, 0.216049403}, //
+
2731 {0.0720164701, 0.216049403}, //
+
2732 {0.0555555597, 0.166666672}, //
+
2733 {0.166666672, 0.166666672}, //
+
2734 });
+
2735 polys.push_back({
+
2736 {-0.166666672, -0.5}, //
+
2737 {-0.117283955, -0.401234567}, //
+
2738 {-0.117283955, -0.401234567}, //
+
2739 {-0.117283955, -0.401234567}, //
+
2740 {-0.104938284, -0.376543224}, //
+
2741 {-0.1090535, -0.376543224}, //
+
2742 {-0.117283955, -0.376543224}, //
+
2743 {-0.117283955, -0.372428}, //
+
2744 {-0.117283955, -0.364197552}, //
+
2745 {-0.113168724, -0.364197552}, //
+
2746 {-0.104938269, -0.364197552}, //
+
2747 {-0.104938269, -0.368312776}, //
+
2748 {-0.104938269, -0.376543194}, //
+
2749 {-0.0308642201, -0.228395075}, //
+
2750 {-0.0349794254, -0.228395075}, //
+
2751 {-0.0432098769, -0.228395075}, //
+
2752 {-0.0432098769, -0.224279851}, //
+
2753 {-0.0432098769, -0.216049403}, //
+
2754 {-0.0390946493, -0.216049403}, //
+
2755 {-0.0308641978, -0.216049403}, //
+
2756 {-0.0308641978, -0.220164627}, //
+
2757 {-0.0308641978, -0.22839503}, //
+
2758 {-2.8974485e-09, -0.166666672}, //
+
2759 {-0.0555555597, -0.166666672}, //
+
2760 {-0.0720164701, -0.216049403}, //
+
2761 {-0.0679012388, -0.216049403}, //
+
2762 {-0.0679012388, -0.220164627}, //
+
2763 {-0.0679012388, -0.228395075}, //
+
2764 {-0.0720164627, -0.228395075}, //
+
2765 {-0.076131694, -0.228395075}, //
+
2766 {-0.104938284, -0.314814836}, //
+
2767 {-0.092592597, -0.314814836}, //
+
2768 {-0.092592597, -0.327160507}, //
+
2769 {-0.092592597, -0.351851851}, //
+
2770 {-0.104938276, -0.351851851}, //
+
2771 {-0.117283955, -0.351851851}, //
+
2772 {-0.146090552, -0.438271612}, //
+
2773 {-0.141975313, -0.438271612}, //
+
2774 {-0.141975313, -0.442386836}, //
+
2775 {-0.141975313, -0.450617284}, //
+
2776 {-0.146090537, -0.450617284}, //
+
2777 {-0.150205776, -0.450617284}, //
+
2778 });
+
2779 polys.push_back({
+
2780 {0.141975313, 0.179012358}, //
+
2781 {0.141975313, 0.183127582}, //
+
2782 {0.141975313, 0.19135803}, //
+
2783 {0.146090537, 0.19135803}, //
+
2784 {0.154320985, 0.19135803}, //
+
2785 {0.154320985, 0.187242806}, //
+
2786 {0.154320985, 0.179012358}, //
+
2787 {0.150205761, 0.179012358}, //
+
2788 });
+
2789 polys.push_back({
+
2790 {0.154320985, 0.216049403}, //
+
2791 {0.150205761, 0.216049403}, //
+
2792 {0.141975313, 0.216049403}, //
+
2793 {0.141975313, 0.220164627}, //
+
2794 {0.141975313, 0.228395075}, //
+
2795 {0.146090537, 0.228395075}, //
+
2796 {0.154320985, 0.228395075}, //
+
2797 {0.154320985, 0.224279851}, //
+
2798 });
+
2799 polys.push_back({
+
2800 {0.129629627, 0.203703716}, //
+
2801 {0.117283948, 0.203703716}, //
+
2802 {0.092592597, 0.203703716}, //
+
2803 {0.092592597, 0.216049403}, //
+
2804 {0.092592597, 0.240740761}, //
+
2805 {0.104938276, 0.240740761}, //
+
2806 {0.129629627, 0.240740761}, //
+
2807 {0.129629627, 0.228395075}, //
+
2808 });
+
2809 polys.push_back({
+
2810 {0.104938269, 0.179012358}, //
+
2811 {0.104938269, 0.183127582}, //
+
2812 {0.104938269, 0.19135803}, //
+
2813 {0.1090535, 0.19135803}, //
+
2814 {0.117283955, 0.19135803}, //
+
2815 {0.117283955, 0.187242806}, //
+
2816 {0.117283955, 0.179012358}, //
+
2817 {0.113168724, 0.179012358}, //
+
2818 });
+
2819 polys.push_back({
+
2820 {0.0679012388, 0.179012358}, //
+
2821 {0.0679012388, 0.183127582}, //
+
2822 {0.0679012388, 0.19135803}, //
+
2823 {0.0720164627, 0.19135803}, //
+
2824 {0.0802469105, 0.19135803}, //
+
2825 {0.0802469105, 0.187242806}, //
+
2826 {0.0802469105, 0.179012358}, //
+
2827 {0.0761316866, 0.179012358}, //
+
2828 });
+
2829 polys.push_back({
+
2830 {0.154320985, 0.253086448}, //
+
2831 {0.150205761, 0.253086448}, //
+
2832 {0.141975313, 0.253086448}, //
+
2833 {0.141975313, 0.257201672}, //
+
2834 {0.141975313, 0.265432119}, //
+
2835 {0.146090537, 0.265432119}, //
+
2836 {0.154320985, 0.265432119}, //
+
2837 {0.154320985, 0.261316895}, //
+
2838 });
+
2839 polys.push_back({
+
2840 {0.154320985, 0.290123463}, //
+
2841 {0.150205761, 0.290123463}, //
+
2842 {0.141975313, 0.290123463}, //
+
2843 {0.141975313, 0.294238687}, //
+
2844 {0.141975313, 0.302469134}, //
+
2845 {0.146090537, 0.302469134}, //
+
2846 {0.154320985, 0.302469134}, //
+
2847 {0.154320985, 0.29835391}, //
+
2848 });
+
2849 polys.push_back({
+
2850 {0.154320985, 0.327160507}, //
+
2851 {0.150205761, 0.327160507}, //
+
2852 {0.141975313, 0.327160507}, //
+
2853 {0.141975313, 0.331275731}, //
+
2854 {0.141975313, 0.339506179}, //
+
2855 {0.146090537, 0.339506179}, //
+
2856 {0.154320985, 0.339506179}, //
+
2857 {0.154320985, 0.335390955}, //
+
2858 });
+
2859 polys.push_back({
+
2860 {0.141975313, 0.364197552}, //
+
2861 {0.141975313, 0.368312776}, //
+
2862 {0.141975313, 0.376543224}, //
+
2863 {0.146090537, 0.376543224}, //
+
2864 {0.154320985, 0.376543224}, //
+
2865 {0.154320985, 0.372428}, //
+
2866 {0.154320985, 0.364197552}, //
+
2867 {0.150205761, 0.364197552}, //
+
2868 });
+
2869 polys.push_back({
+
2870 {0.154320985, 0.401234567}, //
+
2871 {0.150205761, 0.401234567}, //
+
2872 {0.141975313, 0.401234567}, //
+
2873 {0.141975313, 0.405349791}, //
+
2874 {0.141975313, 0.413580239}, //
+
2875 {0.146090537, 0.413580239}, //
+
2876 {0.154320985, 0.413580239}, //
+
2877 {0.154320985, 0.409465015}, //
+
2878 });
+
2879 polys.push_back({
+
2880 {0.117283955, 0.253086448}, //
+
2881 {0.113168724, 0.253086448}, //
+
2882 {0.104938269, 0.253086448}, //
+
2883 {0.104938269, 0.257201672}, //
+
2884 {0.104938269, 0.265432119}, //
+
2885 {0.1090535, 0.265432119}, //
+
2886 {0.117283955, 0.265432119}, //
+
2887 {0.117283955, 0.261316895}, //
+
2888 });
+
2889 polys.push_back({
+
2890 {0.117283955, 0.290123463}, //
+
2891 {0.113168724, 0.290123463}, //
+
2892 {0.104938269, 0.290123463}, //
+
2893 {0.104938269, 0.294238687}, //
+
2894 {0.104938269, 0.302469134}, //
+
2895 {0.1090535, 0.302469134}, //
+
2896 {0.117283955, 0.302469134}, //
+
2897 {0.117283955, 0.29835391}, //
+
2898 });
+
2899 polys.push_back({
+
2900 {-0.0679012388, -0.302469134}, //
+
2901 {-0.0720164627, -0.302469134}, //
+
2902 {-0.0802469105, -0.302469134}, //
+
2903 {-0.0802469105, -0.29835391}, //
+
2904 {-0.0802469105, -0.290123463}, //
+
2905 {-0.0761316866, -0.290123463}, //
+
2906 {-0.0679012388, -0.290123463}, //
+
2907 {-0.0679012388, -0.294238687}, //
+
2908 });
+
2909 polys.push_back({
+
2910 {-0.0679012388, -0.265432119}, //
+
2911 {-0.0720164627, -0.265432119}, //
+
2912 {-0.0802469105, -0.265432119}, //
+
2913 {-0.0802469105, -0.261316895}, //
+
2914 {-0.0802469105, -0.253086448}, //
+
2915 {-0.0761316866, -0.253086448}, //
+
2916 {-0.0679012388, -0.253086448}, //
+
2917 {-0.0679012388, -0.257201672}, //
+
2918 });
+
2919 polys.push_back({
+
2920 {-0.0308641978, -0.19135803}, //
+
2921 {-0.0349794254, -0.19135803}, //
+
2922 {-0.0432098769, -0.19135803}, //
+
2923 {-0.0432098769, -0.187242806}, //
+
2924 {-0.0432098769, -0.179012358}, //
+
2925 {-0.0390946493, -0.179012358}, //
+
2926 {-0.0308641978, -0.179012358}, //
+
2927 {-0.0308641978, -0.183127582}, //
+
2928 });
+
2929 TestPoly(polys, 210);
+
2930}
+
2931
+
2932TEST(Polygon, BigSponge) {
+
2933 Polygons polys;
+
2934 polys.push_back({
+
2935 {0.5, 0.5}, //
+
2936 {0.487654328, 0.4876543283834}, //
+
2937 {0.487654328, 0.4876543283869}, //
+
2938 {0.487654328, 0.4753086573868}, //
+
2939 {0.475308657, 0.4753086573870}, //
+
2940 {0.475308657, 0.4753086573835}, //
+
2941 {0.462962955, 0.4629629553833}, //
+
2942 {0.462962955, 0.425925943857}, //
+
2943 {0.42592594, 0.425925943830}, //
+
2944 {0.413580239, 0.4135802393832}, //
+
2945 {0.413580239, 0.4135802393861}, //
+
2946 {0.413580239, 0.4012345673862}, //
+
2947 {0.401234567, 0.4012345673863}, //
+
2948 {0.401234567, 0.4012345673831}, //
+
2949 {0.388888896, 0.3888888963836}, //
+
2950 {0.388888896, 0.3888888963826}, //
+
2951 {0.388888896, 0.2777777913834}, //
+
2952 {0.277777791, 0.2777777913842}, //
+
2953 {0.277777791, 0.2777777913829}, //
+
2954 {0.265432119, 0.2654321193827}, //
+
2955 {0.265432119, 0.2654321193840}, //
+
2956 {0.265432119, 0.2530864483839}, //
+
2957 {0.253086448, 0.2530864483841}, //
+
2958 {0.253086448, 0.2530864483828}, //
+
2959 {0.240740746, 0.2407407463824}, //
+
2960 {0.240740761, 0.2407407463783}, //
+
2961 {0.240740761, 0.2037037163781}, //
+
2962 {0.203703731, 0.2037037163784}, //
+
2963 {0.203703731, 0.2037037463825}, //
+
2964 {0.19135803, 0.191358033823}, //
+
2965 {0.19135803, 0.191358033782}, //
+
2966 {0.19135803, 0.1790123583776}, //
+
2967 {0.179012358, 0.1790123583785}, //
+
2968 {0.179012358, 0.1790123583826}, //
+
2969 {0.166666672, 0.1666666573822}, //
+
2970 {0.166666672, -0.1666666723546}, //
+
2971 {-0.166666672, -0.1666666723871}, //
+
2972 {-0.166666672, -0.1666666573837}, //
+
2973 {-0.179012358, -0.1790123583818}, //
+
2974 {-0.179012358, -0.191358033565}, //
+
2975 {-0.19135803, -0.191358033820}, //
+
2976 {-0.203703731, -0.2037037313821}, //
+
2977 {-0.203703716, -0.2037037313562}, //
+
2978 {-0.203703716, -0.2407407613563}, //
+
2979 {-0.240740746, -0.2407407613564}, //
+
2980 {-0.240740746, -0.2407407313819}, //
+
2981 {-0.253086448, -0.2530864483816}, //
+
2982 {-0.253086448, -0.2654321193519}, //
+
2983 {-0.265432119, -0.2654321193817}, //
+
2984 {-0.277777791, -0.2777777913815}, //
+
2985 {-0.277777791, -0.3888888963485}, //
+
2986 {-0.388888896, -0.3888888963808}, //
+
2987 {-0.401234567, -0.4012345673814}, //
+
2988 {-0.401234567, -0.4135802393509}, //
+
2989 {-0.413580239, -0.4135802393813}, //
+
2990 {-0.42592594, -0.425925943809}, //
+
2991 {-0.42592594, -0.4629629553504}, //
+
2992 {-0.462962955, -0.4629629553810}, //
+
2993 {-0.475308657, -0.4753086573811}, //
+
2994 {-0.475308657, -0.4876543283505}, //
+
2995 {-0.487654328, -0.4876543283812}, //
+
2996 {-0.5, -0.5}, //
+
2997 {0.5, -0.5}, //
+
2998 });
+
2999 polys.push_back({
+
3000 {0.487654328, -0.4876543282702}, //
+
3001 {0.475308657, -0.4876543282704}, //
+
3002 {0.475308657, -0.4753086572705}, //
+
3003 {0.487654328, -0.4753086572703}, //
+
3004 });
+
3005 polys.push_back({
+
3006 {0.450617284, -0.4753086572706}, //
+
3007 {0.450617284, -0.4876543282707}, //
+
3008 {0.438271612, -0.4876543282709}, //
+
3009 {0.438271612, -0.4753086572708}, //
+
3010 });
+
3011 polys.push_back({
+
3012 {0.462962955, -0.4629629552710}, //
+
3013 {0.42592591, -0.4629629552723}, //
+
3014 {0.42592591, -0.425925912735}, //
+
3015 {0.462962955, -0.425925912714}, //
+
3016 });
+
3017 polys.push_back({
+
3018 {0.487654328, -0.4506172842711}, //
+
3019 {0.475308657, -0.4506172842713}, //
+
3020 {0.475308657, -0.4382716122715}, //
+
3021 {0.487654328, -0.4382716122712}, //
+
3022 });
+
3023 polys.push_back({
+
3024 {0.413580239, -0.4753086572716}, //
+
3025 {0.413580239, -0.4876543282717}, //
+
3026 {0.401234567, -0.4876543282718}, //
+
3027 {0.401234567, -0.4753086572719}, //
+
3028 });
+
3029 polys.push_back({
+
3030 {0.376543224, -0.4753086572720}, //
+
3031 {0.376543224, -0.4876543282721}, //
+
3032 {0.364197552, -0.4876543282756}, //
+
3033 {0.364197552, -0.4753086572722}, //
+
3034 });
+
3035 polys.push_back({
+
3036 {0.413580239, -0.4382716122724}, //
+
3037 {0.413580239, -0.4506172842725}, //
+
3038 {0.401234567, -0.4506172842726}, //
+
3039 {0.401234567, -0.4382716122727}, //
+
3040 });
+
3041 polys.push_back({
+
3042 {0.376543224, -0.4506172842728}, //
+
3043 {0.364197552, -0.4506172842762}, //
+
3044 {0.364197552, -0.4382716122730}, //
+
3045 {0.376543224, -0.4382716122729}, //
+
3046 });
+
3047 polys.push_back({
+
3048 {0.487654328, -0.4135802392731}, //
+
3049 {0.475308657, -0.4135802392733}, //
+
3050 {0.475308657, -0.4012345672734}, //
+
3051 {0.487654328, -0.4012345672732}, //
+
3052 });
+
3053 polys.push_back({
+
3054 {0.450617284, -0.4135802392736}, //
+
3055 {0.438271612, -0.4135802392739}, //
+
3056 {0.438271612, -0.4012345672738}, //
+
3057 {0.450617284, -0.4012345672737}, //
+
3058 });
+
3059 polys.push_back({
+
3060 {0.487654328, -0.3765432242740}, //
+
3061 {0.475308657, -0.3765432242742}, //
+
3062 {0.475308657, -0.3641975522799}, //
+
3063 {0.487654328, -0.3641975522741}, //
+
3064 });
+
3065 polys.push_back({
+
3066 {0.450617284, -0.3765432242743}, //
+
3067 {0.438271612, -0.3765432242745}, //
+
3068 {0.438271612, -0.3641975522801}, //
+
3069 {0.450617284, -0.3641975522744}, //
+
3070 });
+
3071 polys.push_back({
+
3072 {0.413580239, -0.4135802392746}, //
+
3073 {0.401234567, -0.4135802392748}, //
+
3074 {0.401234567, -0.4012345672749}, //
+
3075 {0.413580239, -0.4012345672747}, //
+
3076 });
+
3077 polys.push_back({
+
3078 {0.376543224, -0.4135802392750}, //
+
3079 {0.364197552, -0.4135802392781}, //
+
3080 {0.364197552, -0.4012345672752}, //
+
3081 {0.376543224, -0.4012345672751}, //
+
3082 });
+
3083 polys.push_back({
+
3084 {0.413580239, -0.3641975522753}, //
+
3085 {0.413580239, -0.3765432242754}, //
+
3086 {0.401234567, -0.3765432242755}, //
+
3087 {0.401234567, -0.3641975522808}, //
+
3088 });
+
3089 polys.push_back({
+
3090 {0.339506179, -0.4753086572757}, //
+
3091 {0.339506179, -0.4876543282758}, //
+
3092 {0.327160507, -0.4876543282759}, //
+
3093 {0.327160507, -0.4753086572760}, //
+
3094 });
+
3095 polys.push_back({
+
3096 {0.351851851, -0.4629629552761}, //
+
3097 {0.314814806, -0.4629629552764}, //
+
3098 {0.314814806, -0.425925912783}, //
+
3099 {0.351851851, -0.425925912763}, //
+
3100 });
+
3101 polys.push_back({
+
3102 {0.302469134, -0.4753086572765}, //
+
3103 {0.302469134, -0.4876543282766}, //
+
3104 {0.290123463, -0.4876543282767}, //
+
3105 {0.290123463, -0.4753086572768}, //
+
3106 });
+
3107 polys.push_back({
+
3108 {0.265432119, -0.4876543282769}, //
+
3109 {0.253086448, -0.4876543282772}, //
+
3110 {0.253086448, -0.4753086572771}, //
+
3111 {0.265432119, -0.4753086572770}, //
+
3112 });
+
3113 polys.push_back({
+
3114 {0.302469134, -0.4506172842773}, //
+
3115 {0.290123463, -0.4506172842775}, //
+
3116 {0.290123463, -0.4382716122776}, //
+
3117 {0.302469134, -0.4382716122774}, //
+
3118 });
+
3119 polys.push_back({
+
3120 {0.265432119, -0.4506172842777}, //
+
3121 {0.253086448, -0.4506172842779}, //
+
3122 {0.253086448, -0.4382716122780}, //
+
3123 {0.265432119, -0.4382716122778}, //
+
3124 });
+
3125 polys.push_back({
+
3126 {0.339506179, -0.4012345672782}, //
+
3127 {0.339506179, -0.4135802392784}, //
+
3128 {0.327160507, -0.4135802392785}, //
+
3129 {0.327160507, -0.4012345672786}, //
+
3130 });
+
3131 polys.push_back({
+
3132 {0.388888896, -0.3888888962787}, //
+
3133 {0.277777791, -0.3888888962844}, //
+
3134 {0.277777791, -0.2777777912848}, //
+
3135 {0.388888896, -0.2777777912814}, //
+
3136 });
+
3137 polys.push_back({
+
3138 {0.302469134, -0.4135802392788}, //
+
3139 {0.290123463, -0.4135802392790}, //
+
3140 {0.290123463, -0.4012345672791}, //
+
3141 {0.302469134, -0.4012345672789}, //
+
3142 });
+
3143 polys.push_back({
+
3144 {0.265432119, -0.4135802392792}, //
+
3145 {0.253086448, -0.4135802392795}, //
+
3146 {0.253086448, -0.4012345672794}, //
+
3147 {0.265432119, -0.4012345672793}, //
+
3148 });
+
3149 polys.push_back({
+
3150 {0.265432119, -0.3765432242796}, //
+
3151 {0.253086448, -0.3765432242798}, //
+
3152 {0.253086448, -0.3641975522842}, //
+
3153 {0.265432119, -0.3641975522797}, //
+
3154 });
+
3155 polys.push_back({
+
3156 {0.487654328, -0.3395061792800}, //
+
3157 {0.475308657, -0.3395061792804}, //
+
3158 {0.475308657, -0.3271605072805}, //
+
3159 {0.487654328, -0.3271605072803}, //
+
3160 });
+
3161 polys.push_back({
+
3162 {0.462962955, -0.3518518512802}, //
+
3163 {0.42592591, -0.3518518512810}, //
+
3164 {0.42592591, -0.3148148062807}, //
+
3165 {0.462962955, -0.3148148062806}, //
+
3166 });
+
3167 polys.push_back({
+
3168 {0.413580239, -0.3395061792809}, //
+
3169 {0.401234567, -0.3395061792812}, //
+
3170 {0.401234567, -0.3271605072813}, //
+
3171 {0.413580239, -0.3271605072811}, //
+
3172 });
+
3173 polys.push_back({
+
3174 {0.487654328, -0.3024691342815}, //
+
3175 {0.475308657, -0.3024691342818}, //
+
3176 {0.475308657, -0.2901234632817}, //
+
3177 {0.487654328, -0.2901234632816}, //
+
3178 });
+
3179 polys.push_back({
+
3180 {0.450617284, -0.3024691342819}, //
+
3181 {0.438271612, -0.3024691342822}, //
+
3182 {0.438271612, -0.2901234632821}, //
+
3183 {0.450617284, -0.2901234632820}, //
+
3184 });
+
3185 polys.push_back({
+
3186 {0.487654328, -0.2654321192823}, //
+
3187 {0.475308657, -0.2654321192825}, //
+
3188 {0.475308657, -0.2530864482826}, //
+
3189 {0.487654328, -0.2530864482824}, //
+
3190 });
+
3191 polys.push_back({
+
3192 {0.450617284, -0.2530864482827}, //
+
3193 {0.450617284, -0.2654321192828}, //
+
3194 {0.438271612, -0.2654321192829}, //
+
3195 {0.438271612, -0.2530864482830}, //
+
3196 });
+
3197 polys.push_back({
+
3198 {0.413580239, -0.2901234632831}, //
+
3199 {0.413580239, -0.3024691342832}, //
+
3200 {0.401234567, -0.3024691342834}, //
+
3201 {0.401234567, -0.2901234632833}, //
+
3202 });
+
3203 polys.push_back({
+
3204 {0.413580239, -0.2530864482835}, //
+
3205 {0.413580239, -0.2654321192836}, //
+
3206 {0.401234567, -0.2654321192837}, //
+
3207 {0.401234567, -0.2530864482838}, //
+
3208 });
+
3209 polys.push_back({
+
3210 {0.376543224, -0.2530864482839}, //
+
3211 {0.376543224, -0.2654321192840}, //
+
3212 {0.364197552, -0.2654321192849}, //
+
3213 {0.364197552, -0.2530864482841}, //
+
3214 });
+
3215 polys.push_back({
+
3216 {0.265432119, -0.3395061792843}, //
+
3217 {0.253086448, -0.3395061792847}, //
+
3218 {0.253086448, -0.3271605072846}, //
+
3219 {0.265432119, -0.3271605072845}, //
+
3220 });
+
3221 polys.push_back({
+
3222 {0.339506179, -0.2530864482850}, //
+
3223 {0.339506179, -0.2654321192851}, //
+
3224 {0.327160507, -0.2654321192852}, //
+
3225 {0.327160507, -0.2530864482853}, //
+
3226 });
+
3227 polys.push_back({
+
3228 {0.265432119, -0.3024691342854}, //
+
3229 {0.253086448, -0.3024691342857}, //
+
3230 {0.253086448, -0.2901234632856}, //
+
3231 {0.265432119, -0.2901234632855}, //
+
3232 });
+
3233 polys.push_back({
+
3234 {0.302469134, -0.2530864482858}, //
+
3235 {0.302469134, -0.2654321192859}, //
+
3236 {0.290123463, -0.2654321192860}, //
+
3237 {0.290123463, -0.2530864482861}, //
+
3238 });
+
3239 polys.push_back({
+
3240 {0.265432119, -0.2654321192862}, //
+
3241 {0.253086448, -0.2654321192864}, //
+
3242 {0.253086448, -0.2530864482865}, //
+
3243 {0.265432119, -0.2530864482863}, //
+
3244 });
+
3245 polys.push_back({
+
3246 {0.228395075, -0.4876543282866}, //
+
3247 {0.216049403, -0.4876543282868}, //
+
3248 {0.216049403, -0.4753086572869}, //
+
3249 {0.228395075, -0.4753086572867}, //
+
3250 });
+
3251 polys.push_back({
+
3252 {0.240740761, -0.4629629552870}, //
+
3253 {0.203703731, -0.4629629552875}, //
+
3254 {0.203703731, -0.425925912890}, //
+
3255 {0.240740761, -0.425925912874}, //
+
3256 });
+
3257 polys.push_back({
+
3258 {0.19135803, -0.4753086572871}, //
+
3259 {0.19135803, -0.4876543282872}, //
+
3260 {0.179012358, -0.4876543282879}, //
+
3261 {0.179012358, -0.4753086572873}, //
+
3262 });
+
3263 polys.push_back({
+
3264 {0.19135803, -0.4506172842876}, //
+
3265 {0.179012358, -0.4506172842884}, //
+
3266 {0.179012358, -0.4382716122878}, //
+
3267 {0.19135803, -0.4382716122877}, //
+
3268 });
+
3269 polys.push_back({
+
3270 {0.154320985, -0.4753086572880}, //
+
3271 {0.154320985, -0.4876543282881}, //
+
3272 {0.141975313, -0.4876543282882}, //
+
3273 {0.141975313, -0.4753086572883}, //
+
3274 });
+
3275 polys.push_back({
+
3276 {0.154320985, -0.4382716122885}, //
+
3277 {0.154320985, -0.4506172842886}, //
+
3278 {0.141975313, -0.4506172842887}, //
+
3279 {0.141975313, -0.4382716122889}, //
+
3280 });
+
3281 polys.push_back({
+
3282 {0.129629627, -0.425925912888}, //
+
3283 {0.129629627, -0.4629629552916}, //
+
3284 {0.0925925896, -0.4629629552921}, //
+
3285 {0.0925925896, -0.425925912936}, //
+
3286 });
+
3287 polys.push_back({
+
3288 {0.228395075, -0.4135802392891}, //
+
3289 {0.216049403, -0.4135802392893}, //
+
3290 {0.216049403, -0.4012345672894}, //
+
3291 {0.228395075, -0.4012345672892}, //
+
3292 });
+
3293 polys.push_back({
+
3294 {0.19135803, -0.4135802392895}, //
+
3295 {0.179012358, -0.4135802392903}, //
+
3296 {0.179012358, -0.4012345672897}, //
+
3297 {0.19135803, -0.4012345672896}, //
+
3298 });
+
3299 polys.push_back({
+
3300 {0.228395075, -0.3765432242898}, //
+
3301 {0.216049403, -0.3765432242900}, //
+
3302 {0.216049403, -0.3641975522956}, //
+
3303 {0.228395075, -0.3641975522899}, //
+
3304 });
+
3305 polys.push_back({
+
3306 {0.19135803, -0.3765432242901}, //
+
3307 {0.179012358, -0.3765432242908}, //
+
3308 {0.179012358, -0.3641975522958}, //
+
3309 {0.19135803, -0.3641975522902}, //
+
3310 });
+
3311 polys.push_back({
+
3312 {0.154320985, -0.4012345672904}, //
+
3313 {0.154320985, -0.4135802392905}, //
+
3314 {0.141975313, -0.4135802392906}, //
+
3315 {0.141975313, -0.4012345672907}, //
+
3316 });
+
3317 polys.push_back({
+
3318 {0.154320985, -0.3641975522909}, //
+
3319 {0.154320985, -0.3765432242910}, //
+
3320 {0.141975313, -0.3765432242911}, //
+
3321 {0.141975313, -0.3641975522965}, //
+
3322 });
+
3323 polys.push_back({
+
3324 {0.117283955, -0.4753086572912}, //
+
3325 {0.117283955, -0.4876543282913}, //
+
3326 {0.104938276, -0.4876543282915}, //
+
3327 {0.104938276, -0.4753086572914}, //
+
3328 });
+
3329 polys.push_back({
+
3330 {0.0802469105, -0.4753086572917}, //
+
3331 {0.0802469105, -0.4876543282918}, //
+
3332 {0.0679012313, -0.4876543282919}, //
+
3333 {0.0679012313, -0.4753086572920}, //
+
3334 });
+
3335 polys.push_back({
+
3336 {0.0802469105, -0.4382716122922}, //
+
3337 {0.0802469105, -0.4506172842923}, //
+
3338 {0.0679012313, -0.4506172842924}, //
+
3339 {0.0679012313, -0.4382716122925}, //
+
3340 });
+
3341 polys.push_back({
+
3342 {0.0432098769, -0.4753086572926}, //
+
3343 {0.0432098769, -0.4876543282927}, //
+
3344 {0.0308641978, -0.4876543282928}, //
+
3345 {0.0308641978, -0.4753086572929}, //
+
3346 });
+
3347 polys.push_back({
+
3348 {0.00617283955, -0.4753086572930}, //
+
3349 {0.00617283955, -0.4876543283272}, //
+
3350 {-0.00617283955, -0.4876543283273}, //
+
3351 {-0.00617283955, -0.4753086573274}, //
+
3352 });
+
3353 polys.push_back({
+
3354 {0.0432098769, -0.4506172842931}, //
+
3355 {0.0308641978, -0.4506172842933}, //
+
3356 {0.0308641978, -0.4382716122934}, //
+
3357 {0.0432098769, -0.4382716122932}, //
+
3358 });
+
3359 polys.push_back({
+
3360 {0.0185185187, -0.425925912935}, //
+
3361 {0.0185185187, -0.4629629553275}, //
+
3362 {-0.0185185187, -0.4629629553280}, //
+
3363 {-0.0185185187, -0.425925913299}, //
+
3364 });
+
3365 polys.push_back({
+
3366 {0.117283955, -0.4135802392937}, //
+
3367 {0.104938276, -0.4135802392940}, //
+
3368 {0.104938276, -0.4012345672939}, //
+
3369 {0.117283955, -0.4012345672938}, //
+
3370 });
+
3371 polys.push_back({
+
3372 {0.0802469105, -0.4135802392941}, //
+
3373 {0.0679012313, -0.4135802392943}, //
+
3374 {0.0679012313, -0.4012345672944}, //
+
3375 {0.0802469105, -0.4012345672942}, //
+
3376 });
+
3377 polys.push_back({
+
3378 {0.117283955, -0.3765432242945}, //
+
3379 {0.104938276, -0.3765432242947}, //
+
3380 {0.104938276, -0.3641975522996}, //
+
3381 {0.117283955, -0.3641975522946}, //
+
3382 });
+
3383 polys.push_back({
+
3384 {0.0802469105, -0.3641975522948}, //
+
3385 {0.0802469105, -0.3765432242949}, //
+
3386 {0.0679012313, -0.3765432242950}, //
+
3387 {0.0679012313, -0.3641975522998}, //
+
3388 });
+
3389 polys.push_back({
+
3390 {0.0432098769, -0.4135802392951}, //
+
3391 {0.0308641978, -0.4135802392953}, //
+
3392 {0.0308641978, -0.4012345672954}, //
+
3393 {0.0432098769, -0.4012345672952}, //
+
3394 });
+
3395 polys.push_back({
+
3396 {0.00617283955, -0.4012345672955}, //
+
3397 {0.00617283955, -0.4135802393300}, //
+
3398 {-0.00617283955, -0.4135802393301}, //
+
3399 {-0.00617283955, -0.4012345673302}, //
+
3400 });
+
3401 polys.push_back({
+
3402 {0.240740761, -0.3518518512957}, //
+
3403 {0.203703731, -0.3518518512962}, //
+
3404 {0.203703731, -0.3148148062961}, //
+
3405 {0.240740761, -0.3148148062960}, //
+
3406 });
+
3407 polys.push_back({
+
3408 {0.19135803, -0.3395061792959}, //
+
3409 {0.179012358, -0.3395061792967}, //
+
3410 {0.179012358, -0.3271605072964}, //
+
3411 {0.19135803, -0.3271605072963}, //
+
3412 });
+
3413 polys.push_back({
+
3414 {0.154320985, -0.3395061792966}, //
+
3415 {0.141975313, -0.3395061792969}, //
+
3416 {0.141975313, -0.3271605072970}, //
+
3417 {0.154320985, -0.3271605072968}, //
+
3418 });
+
3419 polys.push_back({
+
3420 {0.129629627, -0.3148148062971}, //
+
3421 {0.129629627, -0.3518518512997}, //
+
3422 {0.0925925896, -0.3518518513000}, //
+
3423 {0.0925925896, -0.3148148063001}, //
+
3424 });
+
3425 polys.push_back({
+
3426 {0.228395075, -0.3024691342972}, //
+
3427 {0.216049403, -0.3024691342975}, //
+
3428 {0.216049403, -0.2901234632974}, //
+
3429 {0.228395075, -0.2901234632973}, //
+
3430 });
+
3431 polys.push_back({
+
3432 {0.19135803, -0.3024691342976}, //
+
3433 {0.179012358, -0.3024691342986}, //
+
3434 {0.179012358, -0.2901234632978}, //
+
3435 {0.19135803, -0.2901234632977}, //
+
3436 });
+
3437 polys.push_back({
+
3438 {0.228395075, -0.2654321192979}, //
+
3439 {0.216049403, -0.2654321192981}, //
+
3440 {0.216049403, -0.2530864482982}, //
+
3441 {0.228395075, -0.2530864482980}, //
+
3442 });
+
3443 polys.push_back({
+
3444 {0.19135803, -0.2530864482983}, //
+
3445 {0.19135803, -0.2654321192984}, //
+
3446 {0.179012358, -0.2654321192991}, //
+
3447 {0.179012358, -0.2530864482985}, //
+
3448 });
+
3449 polys.push_back({
+
3450 {0.154320985, -0.2901234632987}, //
+
3451 {0.154320985, -0.3024691342988}, //
+
3452 {0.141975313, -0.3024691342990}, //
+
3453 {0.141975313, -0.2901234632989}, //
+
3454 });
+
3455 polys.push_back({
+
3456 {0.154320985, -0.2530864482992}, //
+
3457 {0.154320985, -0.2654321192993}, //
+
3458 {0.141975313, -0.2654321192994}, //
+
3459 {0.141975313, -0.2530864482995}, //
+
3460 });
+
3461 polys.push_back({
+
3462 {0.0802469105, -0.3395061792999}, //
+
3463 {0.0679012313, -0.3395061793003}, //
+
3464 {0.0679012313, -0.3271605073004}, //
+
3465 {0.0802469105, -0.3271605073002}, //
+
3466 });
+
3467 polys.push_back({
+
3468 {0.055555556, -0.2777777913005}, //
+
3469 {0.055555556, -0.3888888963307}, //
+
3470 {-0.055555556, -0.3888888963369}, //
+
3471 {-0.055555556, -0.2777777913379}, //
+
3472 });
+
3473 polys.push_back({
+
3474 {0.117283955, -0.3024691343006}, //
+
3475 {0.104938276, -0.3024691343009}, //
+
3476 {0.104938276, -0.2901234633008}, //
+
3477 {0.117283955, -0.2901234633007}, //
+
3478 });
+
3479 polys.push_back({
+
3480 {0.0802469105, -0.2901234633010}, //
+
3481 {0.0802469105, -0.3024691343011}, //
+
3482 {0.0679012313, -0.3024691343013}, //
+
3483 {0.0679012313, -0.2901234633012}, //
+
3484 });
+
3485 polys.push_back({
+
3486 {0.117283955, -0.2530864483014}, //
+
3487 {0.117283955, -0.2654321193015}, //
+
3488 {0.104938276, -0.2654321193016}, //
+
3489 {0.104938276, -0.2530864483017}, //
+
3490 });
+
3491 polys.push_back({
+
3492 {0.0802469105, -0.2530864483018}, //
+
3493 {0.0802469105, -0.2654321193019}, //
+
3494 {0.0679012313, -0.2654321193020}, //
+
3495 {0.0679012313, -0.2530864483021}, //
+
3496 });
+
3497 polys.push_back({
+
3498 {0.0432098769, -0.2530864483022}, //
+
3499 {0.0432098769, -0.2654321193023}, //
+
3500 {0.0308641978, -0.2654321193024}, //
+
3501 {0.0308641978, -0.2530864483025}, //
+
3502 });
+
3503 polys.push_back({
+
3504 {0.00617283955, -0.2530864483026}, //
+
3505 {0.00617283955, -0.2654321193380}, //
+
3506 {-0.00617283955, -0.2654321193381}, //
+
3507 {-0.00617283955, -0.2530864483382}, //
+
3508 });
+
3509 polys.push_back({
+
3510 {0.487654328, -0.2283950753027}, //
+
3511 {0.475308657, -0.2283950753029}, //
+
3512 {0.475308657, -0.2160494033030}, //
+
3513 {0.487654328, -0.2160494033028}, //
+
3514 });
+
3515 polys.push_back({
+
3516 {0.462962955, -0.2037037313031}, //
+
3517 {0.462962955, -0.2407407613032}, //
+
3518 {0.42592591, -0.2407407613040}, //
+
3519 {0.42592591, -0.2037037313036}, //
+
3520 });
+
3521 polys.push_back({
+
3522 {0.487654328, -0.191358033033}, //
+
3523 {0.475308657, -0.191358033035}, //
+
3524 {0.475308657, -0.1790123583053}, //
+
3525 {0.487654328, -0.1790123583034}, //
+
3526 });
+
3527 polys.push_back({
+
3528 {0.450617284, -0.191358033037}, //
+
3529 {0.438271612, -0.191358033039}, //
+
3530 {0.438271612, -0.1790123583055}, //
+
3531 {0.450617284, -0.1790123583038}, //
+
3532 });
+
3533 polys.push_back({
+
3534 {0.413580239, -0.2160494033041}, //
+
3535 {0.413580239, -0.2283950753042}, //
+
3536 {0.401234567, -0.2283950753043}, //
+
3537 {0.401234567, -0.2160494033044}, //
+
3538 });
+
3539 polys.push_back({
+
3540 {0.376543224, -0.2160494033045}, //
+
3541 {0.376543224, -0.2283950753046}, //
+
3542 {0.364197552, -0.2283950753073}, //
+
3543 {0.364197552, -0.2160494033047}, //
+
3544 });
+
3545 polys.push_back({
+
3546 {0.413580239, -0.1790123583048}, //
+
3547 {0.413580239, -0.191358033049}, //
+
3548 {0.401234567, -0.191358033050}, //
+
3549 {0.401234567, -0.1790123583064}, //
+
3550 });
+
3551 polys.push_back({
+
3552 {0.376543224, -0.191358033051}, //
+
3553 {0.364197552, -0.191358033077}, //
+
3554 {0.364197552, -0.1790123583066}, //
+
3555 {0.376543224, -0.1790123583052}, //
+
3556 });
+
3557 polys.push_back({
+
3558 {0.487654328, -0.1543209853054}, //
+
3559 {0.475308657, -0.1543209853058}, //
+
3560 {0.475308657, -0.1419753133059}, //
+
3561 {0.487654328, -0.1419753133057}, //
+
3562 });
+
3563 polys.push_back({
+
3564 {0.450617284, -0.1543209853056}, //
+
3565 {0.438271612, -0.1543209853062}, //
+
3566 {0.438271612, -0.1419753133061}, //
+
3567 {0.450617284, -0.1419753133060}, //
+
3568 });
+
3569 polys.push_back({
+
3570 {0.462962955, -0.1296296273063}, //
+
3571 {0.42592591, -0.1296296273127}, //
+
3572 {0.42592591, -0.09259258963118}, //
+
3573 {0.462962955, -0.09259258963116}, //
+
3574 });
+
3575 polys.push_back({
+
3576 {0.413580239, -0.1543209853065}, //
+
3577 {0.401234567, -0.1543209853069}, //
+
3578 {0.401234567, -0.1419753133070}, //
+
3579 {0.413580239, -0.1419753133068}, //
+
3580 });
+
3581 polys.push_back({
+
3582 {0.376543224, -0.1543209853067}, //
+
3583 {0.364197552, -0.1543209853098}, //
+
3584 {0.364197552, -0.1419753133072}, //
+
3585 {0.376543224, -0.1419753133071}, //
+
3586 });
+
3587 polys.push_back({
+
3588 {0.351851851, -0.2037037313074}, //
+
3589 {0.351851851, -0.2407407613075}, //
+
3590 {0.314814806, -0.2407407613076}, //
+
3591 {0.314814806, -0.2037037313079}, //
+
3592 });
+
3593 polys.push_back({
+
3594 {0.339506179, -0.1790123583078}, //
+
3595 {0.339506179, -0.191358033080}, //
+
3596 {0.327160507, -0.191358033081}, //
+
3597 {0.327160507, -0.1790123583096}, //
+
3598 });
+
3599 polys.push_back({
+
3600 {0.302469134, -0.2160494033082}, //
+
3601 {0.302469134, -0.2283950753083}, //
+
3602 {0.290123463, -0.2283950753084}, //
+
3603 {0.290123463, -0.2160494033085}, //
+
3604 });
+
3605 polys.push_back({
+
3606 {0.265432119, -0.2283950753086}, //
+
3607 {0.253086448, -0.2283950753089}, //
+
3608 {0.253086448, -0.2160494033088}, //
+
3609 {0.265432119, -0.2160494033087}, //
+
3610 });
+
3611 polys.push_back({
+
3612 {0.302469134, -0.191358033090}, //
+
3613 {0.290123463, -0.191358033092}, //
+
3614 {0.290123463, -0.1790123583103}, //
+
3615 {0.302469134, -0.1790123583091}, //
+
3616 });
+
3617 polys.push_back({
+
3618 {0.265432119, -0.191358033093}, //
+
3619 {0.253086448, -0.191358033095}, //
+
3620 {0.253086448, -0.1790123583105}, //
+
3621 {0.265432119, -0.1790123583094}, //
+
3622 });
+
3623 polys.push_back({
+
3624 {0.339506179, -0.1543209853097}, //
+
3625 {0.327160507, -0.1543209853100}, //
+
3626 {0.327160507, -0.1419753133101}, //
+
3627 {0.339506179, -0.1419753133099}, //
+
3628 });
+
3629 polys.push_back({
+
3630 {0.351851851, -0.1296296273102}, //
+
3631 {0.314814806, -0.1296296273159}, //
+
3632 {0.314814806, -0.09259258963160}, //
+
3633 {0.351851851, -0.09259258963158}, //
+
3634 });
+
3635 polys.push_back({
+
3636 {0.302469134, -0.1543209853104}, //
+
3637 {0.290123463, -0.1543209853108}, //
+
3638 {0.290123463, -0.1419753133109}, //
+
3639 {0.302469134, -0.1419753133107}, //
+
3640 });
+
3641 polys.push_back({
+
3642 {0.265432119, -0.1543209853106}, //
+
3643 {0.253086448, -0.1543209853112}, //
+
3644 {0.253086448, -0.1419753133111}, //
+
3645 {0.265432119, -0.1419753133110}, //
+
3646 });
+
3647 polys.push_back({
+
3648 {0.487654328, -0.1172839553113}, //
+
3649 {0.475308657, -0.1172839553115}, //
+
3650 {0.475308657, -0.1049382763117}, //
+
3651 {0.487654328, -0.1049382763114}, //
+
3652 });
+
3653 polys.push_back({
+
3654 {0.487654328, -0.08024691053119}, //
+
3655 {0.475308657, -0.08024691053121}, //
+
3656 {0.475308657, -0.06790123133122}, //
+
3657 {0.487654328, -0.06790123133120}, //
+
3658 });
+
3659 polys.push_back({
+
3660 {0.450617284, -0.08024691053123}, //
+
3661 {0.438271612, -0.08024691053126}, //
+
3662 {0.438271612, -0.06790123133125}, //
+
3663 {0.450617284, -0.06790123133124}, //
+
3664 });
+
3665 polys.push_back({
+
3666 {0.413580239, -0.1049382763128}, //
+
3667 {0.413580239, -0.1172839553129}, //
+
3668 {0.401234567, -0.1172839553130}, //
+
3669 {0.401234567, -0.1049382763131}, //
+
3670 });
+
3671 polys.push_back({
+
3672 {0.376543224, -0.1172839553132}, //
+
3673 {0.364197552, -0.1172839553157}, //
+
3674 {0.364197552, -0.1049382763134}, //
+
3675 {0.376543224, -0.1049382763133}, //
+
3676 });
+
3677 polys.push_back({
+
3678 {0.413580239, -0.08024691053135}, //
+
3679 {0.401234567, -0.08024691053137}, //
+
3680 {0.401234567, -0.06790123133138}, //
+
3681 {0.413580239, -0.06790123133136}, //
+
3682 });
+
3683 polys.push_back({
+
3684 {0.376543224, -0.08024691053139}, //
+
3685 {0.364197552, -0.08024691053161}, //
+
3686 {0.364197552, -0.06790123133141}, //
+
3687 {0.376543224, -0.06790123133140}, //
+
3688 });
+
3689 polys.push_back({
+
3690 {0.487654328, -0.04320987693142}, //
+
3691 {0.475308657, -0.04320987693145}, //
+
3692 {0.475308657, -0.03086419783144}, //
+
3693 {0.487654328, -0.03086419783143}, //
+
3694 });
+
3695 polys.push_back({
+
3696 {0.450617284, -0.04320987693146}, //
+
3697 {0.438271612, -0.04320987693149}, //
+
3698 {0.438271612, -0.03086419783148}, //
+
3699 {0.450617284, -0.03086419783147}, //
+
3700 });
+
3701 polys.push_back({
+
3702 {0.487654328, -0.006172839553150}, //
+
3703 {0.475308657, -0.006172839553569}, //
+
3704 {0.475308657, 0.006172839553568}, //
+
3705 {0.487654328, 0.006172839553567}, //
+
3706 });
+
3707 polys.push_back({
+
3708 {0.462962955, -0.01851851873151}, //
+
3709 {0.42592591, -0.01851851873580}, //
+
3710 {0.42592591, 0.01851851873571}, //
+
3711 {0.462962955, 0.01851851873570}, //
+
3712 });
+
3713 polys.push_back({
+
3714 {0.413580239, -0.03086419783152}, //
+
3715 {0.413580239, -0.04320987693153}, //
+
3716 {0.401234567, -0.04320987693155}, //
+
3717 {0.401234567, -0.03086419783154}, //
+
3718 });
+
3719 polys.push_back({
+
3720 {0.413580239, -0.006172839553156}, //
+
3721 {0.401234567, -0.006172839553583}, //
+
3722 {0.401234567, 0.006172839553582}, //
+
3723 {0.413580239, 0.006172839553581}, //
+
3724 });
+
3725 polys.push_back({
+
3726 {0.339506179, -0.06790123133162}, //
+
3727 {0.339506179, -0.08024691053163}, //
+
3728 {0.327160507, -0.08024691053164}, //
+
3729 {0.327160507, -0.06790123133165}, //
+
3730 });
+
3731 polys.push_back({
+
3732 {0.302469134, -0.1172839553166}, //
+
3733 {0.290123463, -0.1172839553168}, //
+
3734 {0.290123463, -0.1049382763169}, //
+
3735 {0.302469134, -0.1049382763167}, //
+
3736 });
+
3737 polys.push_back({
+
3738 {0.265432119, -0.1172839553170}, //
+
3739 {0.253086448, -0.1172839553172}, //
+
3740 {0.253086448, -0.1049382763173}, //
+
3741 {0.265432119, -0.1049382763171}, //
+
3742 });
+
3743 polys.push_back({
+
3744 {0.302469134, -0.08024691053174}, //
+
3745 {0.290123463, -0.08024691053176}, //
+
3746 {0.290123463, -0.06790123133177}, //
+
3747 {0.302469134, -0.06790123133175}, //
+
3748 });
+
3749 polys.push_back({
+
3750 {0.265432119, -0.08024691053178}, //
+
3751 {0.253086448, -0.08024691053181}, //
+
3752 {0.253086448, -0.06790123133180}, //
+
3753 {0.265432119, -0.06790123133179}, //
+
3754 });
+
3755 polys.push_back({
+
3756 {0.388888896, -0.0555555563182}, //
+
3757 {0.277777791, -0.0555555563619}, //
+
3758 {0.277777791, 0.0555555563618}, //
+
3759 {0.388888896, 0.0555555563584}, //
+
3760 });
+
3761 polys.push_back({
+
3762 {0.265432119, -0.04320987693183}, //
+
3763 {0.253086448, -0.04320987693186}, //
+
3764 {0.253086448, -0.03086419783185}, //
+
3765 {0.265432119, -0.03086419783184}, //
+
3766 });
+
3767 polys.push_back({
+
3768 {0.265432119, -0.006172839553187}, //
+
3769 {0.253086448, -0.006172839553622}, //
+
3770 {0.253086448, 0.006172839553621}, //
+
3771 {0.265432119, 0.006172839553620}, //
+
3772 });
+
3773 polys.push_back({
+
3774 {0.240740761, -0.2407407613188}, //
+
3775 {0.203703731, -0.2407407613190}, //
+
3776 {0.203703731, -0.2037037313194}, //
+
3777 {0.240740761, -0.2037037313189}, //
+
3778 });
+
3779 polys.push_back({
+
3780 {0.19135803, -0.2160494033191}, //
+
3781 {0.19135803, -0.2283950753192}, //
+
3782 {0.179012358, -0.2283950753200}, //
+
3783 {0.179012358, -0.2160494033193}, //
+
3784 });
+
3785 polys.push_back({
+
3786 {0.228395075, -0.191358033195}, //
+
3787 {0.216049403, -0.191358033197}, //
+
3788 {0.216049403, -0.1790123583210}, //
+
3789 {0.228395075, -0.1790123583196}, //
+
3790 });
+
3791 polys.push_back({
+
3792 {0.19135803, -0.191358033198}, //
+
3793 {0.179012358, -0.191358033206}, //
+
3794 {0.179012358, -0.1790123583212}, //
+
3795 {0.19135803, -0.1790123583199}, //
+
3796 });
+
3797 polys.push_back({
+
3798 {0.154320985, -0.2160494033201}, //
+
3799 {0.154320985, -0.2283950753202}, //
+
3800 {0.141975313, -0.2283950753203}, //
+
3801 {0.141975313, -0.2160494033204}, //
+
3802 });
+
3803 polys.push_back({
+
3804 {0.129629627, -0.2037037313205}, //
+
3805 {0.129629627, -0.2407407613222}, //
+
3806 {0.0925925896, -0.2407407613223}, //
+
3807 {0.0925925896, -0.2037037313228}, //
+
3808 });
+
3809 polys.push_back({
+
3810 {0.154320985, -0.1790123583207}, //
+
3811 {0.154320985, -0.191358033208}, //
+
3812 {0.141975313, -0.191358033209}, //
+
3813 {0.141975313, -0.1790123583220}, //
+
3814 });
+
3815 polys.push_back({
+
3816 {0.228395075, -0.1543209853211}, //
+
3817 {0.216049403, -0.1543209853215}, //
+
3818 {0.216049403, -0.1419753133216}, //
+
3819 {0.228395075, -0.1419753133214}, //
+
3820 });
+
3821 polys.push_back({
+
3822 {0.19135803, -0.1543209853213}, //
+
3823 {0.179012358, -0.1543209853221}, //
+
3824 {0.179012358, -0.1419753133219}, //
+
3825 {0.19135803, -0.1419753133218}, //
+
3826 });
+
3827 polys.push_back({
+
3828 {0.240740761, -0.1296296273217}, //
+
3829 {0.203703731, -0.1296296273249}, //
+
3830 {0.203703731, -0.09259258963248}, //
+
3831 {0.240740761, -0.09259258963247}, //
+
3832 });
+
3833 polys.push_back({
+
3834 {0.0802469105, -0.2160494033224}, //
+
3835 {0.0802469105, -0.2283950753225}, //
+
3836 {0.0679012313, -0.2283950753226}, //
+
3837 {0.0679012313, -0.2160494033227}, //
+
3838 });
+
3839 polys.push_back({
+
3840 {0.117283955, -0.191358033229}, //
+
3841 {0.104938276, -0.191358033231}, //
+
3842 {0.104938276, -0.1790123583244}, //
+
3843 {0.117283955, -0.1790123583230}, //
+
3844 });
+
3845 polys.push_back({
+
3846 {0.0802469105, -0.1790123583232}, //
+
3847 {0.0802469105, -0.191358033233}, //
+
3848 {0.0679012313, -0.191358033234}, //
+
3849 {0.0679012313, -0.1790123583245}, //
+
3850 });
+
3851 polys.push_back({
+
3852 {0.0432098769, -0.2160494033235}, //
+
3853 {0.0432098769, -0.2283950753236}, //
+
3854 {0.0308641978, -0.2283950753237}, //
+
3855 {0.0308641978, -0.2160494033238}, //
+
3856 });
+
3857 polys.push_back({
+
3858 {0.0185185187, -0.2037037313239}, //
+
3859 {0.0185185187, -0.2407407613520}, //
+
3860 {-0.0185185187, -0.2407407613521}, //
+
3861 {-0.0185185187, -0.2037037313526}, //
+
3862 });
+
3863 polys.push_back({
+
3864 {0.0432098769, -0.191358033240}, //
+
3865 {0.0308641978, -0.191358033242}, //
+
3866 {0.0308641978, -0.1790123583246}, //
+
3867 {0.0432098769, -0.1790123583241}, //
+
3868 });
+
3869 polys.push_back({
+
3870 {0.00617283955, -0.1790123583243}, //
+
3871 {0.00617283955, -0.191358033527}, //
+
3872 {-0.00617283955, -0.191358033528}, //
+
3873 {-0.00617283955, -0.1790123583545}, //
+
3874 });
+
3875 polys.push_back({
+
3876 {0.19135803, -0.1172839553250}, //
+
3877 {0.179012358, -0.1172839553260}, //
+
3878 {0.179012358, -0.1049382763252}, //
+
3879 {0.19135803, -0.1049382763251}, //
+
3880 });
+
3881 polys.push_back({
+
3882 {0.228395075, -0.08024691053253}, //
+
3883 {0.216049403, -0.08024691053255}, //
+
3884 {0.216049403, -0.06790123133256}, //
+
3885 {0.228395075, -0.06790123133254}, //
+
3886 });
+
3887 polys.push_back({
+
3888 {0.19135803, -0.08024691053257}, //
+
3889 {0.179012358, -0.08024691053261}, //
+
3890 {0.179012358, -0.06790123133259}, //
+
3891 {0.19135803, -0.06790123133258}, //
+
3892 });
+
3893 polys.push_back({
+
3894 {0.228395075, -0.04320987693262}, //
+
3895 {0.216049403, -0.04320987693265}, //
+
3896 {0.216049403, -0.03086419783264}, //
+
3897 {0.228395075, -0.03086419783263}, //
+
3898 });
+
3899 polys.push_back({
+
3900 {0.19135803, -0.04320987693266}, //
+
3901 {0.179012358, -0.04320987693271}, //
+
3902 {0.179012358, -0.03086419783268}, //
+
3903 {0.19135803, -0.03086419783267}, //
+
3904 });
+
3905 polys.push_back({
+
3906 {0.240740761, -0.01851851873269}, //
+
3907 {0.203703731, -0.01851851873740}, //
+
3908 {0.203703731, 0.01851851873739}, //
+
3909 {0.240740761, 0.01851851873738}, //
+
3910 });
+
3911 polys.push_back({
+
3912 {0.19135803, -0.006172839553270}, //
+
3913 {0.179012358, -0.006172839553750}, //
+
3914 {0.179012358, 0.006172839553742}, //
+
3915 {0.19135803, 0.006172839553741}, //
+
3916 });
+
3917 polys.push_back({
+
3918 {-0.0308641978, -0.4876543283276}, //
+
3919 {-0.0432098769, -0.4876543283278}, //
+
3920 {-0.0432098769, -0.4753086573279}, //
+
3921 {-0.0308641978, -0.4753086573277}, //
+
3922 });
+
3923 polys.push_back({
+
3924 {-0.0308641978, -0.4506172843281}, //
+
3925 {-0.0432098769, -0.4506172843283}, //
+
3926 {-0.0432098769, -0.4382716123284}, //
+
3927 {-0.0308641978, -0.4382716123282}, //
+
3928 });
+
3929 polys.push_back({
+
3930 {-0.0679012388, -0.4753086573285}, //
+
3931 {-0.0679012388, -0.4876543283286}, //
+
3932 {-0.0802469179, -0.4876543283288}, //
+
3933 {-0.0802469179, -0.4753086573287}, //
+
3934 });
+
3935 polys.push_back({
+
3936 {-0.104938269, -0.4753086573289}, //
+
3937 {-0.104938269, -0.4876543283290}, //
+
3938 {-0.117283948, -0.4876543283291}, //
+
3939 {-0.117283948, -0.4753086573292}, //
+
3940 });
+
3941 polys.push_back({
+
3942 {-0.092592597, -0.4629629553293}, //
+
3943 {-0.129629642, -0.4629629553328}, //
+
3944 {-0.129629642, -0.425925913312}, //
+
3945 {-0.092592597, -0.425925913298}, //
+
3946 });
+
3947 polys.push_back({
+
3948 {-0.0679012388, -0.4506172843294}, //
+
3949 {-0.0802469179, -0.4506172843296}, //
+
3950 {-0.0802469179, -0.4382716123297}, //
+
3951 {-0.0679012388, -0.4382716123295}, //
+
3952 });
+
3953 polys.push_back({
+
3954 {-0.0308641978, -0.4135802393303}, //
+
3955 {-0.0432098769, -0.4135802393305}, //
+
3956 {-0.0432098769, -0.4012345673306}, //
+
3957 {-0.0308641978, -0.4012345673304}, //
+
3958 });
+
3959 polys.push_back({
+
3960 {-0.0679012388, -0.4135802393308}, //
+
3961 {-0.0802469179, -0.4135802393311}, //
+
3962 {-0.0802469179, -0.4012345673310}, //
+
3963 {-0.0679012388, -0.4012345673309}, //
+
3964 });
+
3965 polys.push_back({
+
3966 {-0.104938269, -0.4135802393313}, //
+
3967 {-0.117283948, -0.4135802393315}, //
+
3968 {-0.117283948, -0.4012345673316}, //
+
3969 {-0.104938269, -0.4012345673314}, //
+
3970 });
+
3971 polys.push_back({
+
3972 {-0.0679012388, -0.3765432243317}, //
+
3973 {-0.0802469179, -0.3765432243319}, //
+
3974 {-0.0802469179, -0.3641975523370}, //
+
3975 {-0.0679012388, -0.3641975523318}, //
+
3976 });
+
3977 polys.push_back({
+
3978 {-0.104938269, -0.3641975523320}, //
+
3979 {-0.104938269, -0.3765432243321}, //
+
3980 {-0.117283948, -0.3765432243322}, //
+
3981 {-0.117283948, -0.3641975523372}, //
+
3982 });
+
3983 polys.push_back({
+
3984 {-0.141975313, -0.4753086573323}, //
+
3985 {-0.141975313, -0.4876543283324}, //
+
3986 {-0.154320985, -0.4876543283326}, //
+
3987 {-0.154320985, -0.4753086573325}, //
+
3988 });
+
3989 polys.push_back({
+
3990 {-0.179012358, -0.4753086573327}, //
+
3991 {-0.179012358, -0.4876543283334}, //
+
3992 {-0.19135803, -0.4876543283335}, //
+
3993 {-0.19135803, -0.4753086573336}, //
+
3994 });
+
3995 polys.push_back({
+
3996 {-0.141975313, -0.4506172843329}, //
+
3997 {-0.154320985, -0.4506172843332}, //
+
3998 {-0.154320985, -0.4382716123331}, //
+
3999 {-0.141975313, -0.4382716123330}, //
+
4000 });
+
4001 polys.push_back({
+
4002 {-0.179012358, -0.4382716123333}, //
+
4003 {-0.179012358, -0.4506172843342}, //
+
4004 {-0.19135803, -0.4506172843343}, //
+
4005 {-0.19135803, -0.4382716123345}, //
+
4006 });
+
4007 polys.push_back({
+
4008 {-0.216049403, -0.4753086573337}, //
+
4009 {-0.216049403, -0.4876543283338}, //
+
4010 {-0.228395075, -0.4876543283339}, //
+
4011 {-0.228395075, -0.4753086573340}, //
+
4012 });
+
4013 polys.push_back({
+
4014 {-0.203703716, -0.4629629553341}, //
+
4015 {-0.240740746, -0.4629629553346}, //
+
4016 {-0.240740746, -0.425925913359}, //
+
4017 {-0.203703716, -0.425925913344}, //
+
4018 });
+
4019 polys.push_back({
+
4020 {-0.141975313, -0.4135802393347}, //
+
4021 {-0.154320985, -0.4135802393350}, //
+
4022 {-0.154320985, -0.4012345673349}, //
+
4023 {-0.141975313, -0.4012345673348}, //
+
4024 });
+
4025 polys.push_back({
+
4026 {-0.179012358, -0.4012345673351}, //
+
4027 {-0.179012358, -0.4135802393356}, //
+
4028 {-0.19135803, -0.4135802393357}, //
+
4029 {-0.19135803, -0.4012345673358}, //
+
4030 });
+
4031 polys.push_back({
+
4032 {-0.141975313, -0.3765432243352}, //
+
4033 {-0.154320985, -0.3765432243354}, //
+
4034 {-0.154320985, -0.3641975523403}, //
+
4035 {-0.141975313, -0.3641975523353}, //
+
4036 });
+
4037 polys.push_back({
+
4038 {-0.179012358, -0.3641975523355}, //
+
4039 {-0.179012358, -0.3765432243364}, //
+
4040 {-0.19135803, -0.3765432243365}, //
+
4041 {-0.19135803, -0.3641975523410}, //
+
4042 });
+
4043 polys.push_back({
+
4044 {-0.216049403, -0.4135802393360}, //
+
4045 {-0.228395075, -0.4135802393362}, //
+
4046 {-0.228395075, -0.4012345673363}, //
+
4047 {-0.216049403, -0.4012345673361}, //
+
4048 });
+
4049 polys.push_back({
+
4050 {-0.216049403, -0.3765432243366}, //
+
4051 {-0.228395075, -0.3765432243368}, //
+
4052 {-0.228395075, -0.3641975523412}, //
+
4053 {-0.216049403, -0.3641975523367}, //
+
4054 });
+
4055 polys.push_back({
+
4056 {-0.0679012388, -0.3395061793371}, //
+
4057 {-0.0802469179, -0.3395061793376}, //
+
4058 {-0.0802469179, -0.3271605073375}, //
+
4059 {-0.0679012388, -0.3271605073374}, //
+
4060 });
+
4061 polys.push_back({
+
4062 {-0.092592597, -0.3518518513373}, //
+
4063 {-0.129629642, -0.3518518513405}, //
+
4064 {-0.129629642, -0.3148148063378}, //
+
4065 {-0.092592597, -0.3148148063377}, //
+
4066 });
+
4067 polys.push_back({
+
4068 {-0.0308641978, -0.2654321193383}, //
+
4069 {-0.0432098769, -0.2654321193385}, //
+
4070 {-0.0432098769, -0.2530864483386}, //
+
4071 {-0.0308641978, -0.2530864483384}, //
+
4072 });
+
4073 polys.push_back({
+
4074 {-0.0679012388, -0.3024691343387}, //
+
4075 {-0.0802469179, -0.3024691343390}, //
+
4076 {-0.0802469179, -0.2901234633389}, //
+
4077 {-0.0679012388, -0.2901234633388}, //
+
4078 });
+
4079 polys.push_back({
+
4080 {-0.104938269, -0.2901234633391}, //
+
4081 {-0.104938269, -0.3024691343392}, //
+
4082 {-0.117283948, -0.3024691343394}, //
+
4083 {-0.117283948, -0.2901234633393}, //
+
4084 });
+
4085 polys.push_back({
+
4086 {-0.0679012388, -0.2530864483395}, //
+
4087 {-0.0679012388, -0.2654321193396}, //
+
4088 {-0.0802469179, -0.2654321193397}, //
+
4089 {-0.0802469179, -0.2530864483398}, //
+
4090 });
+
4091 polys.push_back({
+
4092 {-0.104938269, -0.2530864483399}, //
+
4093 {-0.104938269, -0.2654321193400}, //
+
4094 {-0.117283948, -0.2654321193401}, //
+
4095 {-0.117283948, -0.2530864483402}, //
+
4096 });
+
4097 polys.push_back({
+
4098 {-0.141975313, -0.3395061793404}, //
+
4099 {-0.154320985, -0.3395061793408}, //
+
4100 {-0.154320985, -0.3271605073407}, //
+
4101 {-0.141975313, -0.3271605073406}, //
+
4102 });
+
4103 polys.push_back({
+
4104 {-0.179012358, -0.3271605073409}, //
+
4105 {-0.179012358, -0.3395061793411}, //
+
4106 {-0.19135803, -0.3395061793414}, //
+
4107 {-0.19135803, -0.3271605073415}, //
+
4108 });
+
4109 polys.push_back({
+
4110 {-0.203703716, -0.3518518513413}, //
+
4111 {-0.240740746, -0.3518518513417}, //
+
4112 {-0.240740746, -0.3148148063418}, //
+
4113 {-0.203703716, -0.3148148063416}, //
+
4114 });
+
4115 polys.push_back({
+
4116 {-0.141975313, -0.3024691343419}, //
+
4117 {-0.154320985, -0.3024691343422}, //
+
4118 {-0.154320985, -0.2901234633421}, //
+
4119 {-0.141975313, -0.2901234633420}, //
+
4120 });
+
4121 polys.push_back({
+
4122 {-0.179012358, -0.2901234633423}, //
+
4123 {-0.179012358, -0.3024691343429}, //
+
4124 {-0.19135803, -0.3024691343431}, //
+
4125 {-0.19135803, -0.2901234633430}, //
+
4126 });
+
4127 polys.push_back({
+
4128 {-0.141975313, -0.2530864483424}, //
+
4129 {-0.141975313, -0.2654321193425}, //
+
4130 {-0.154320985, -0.2654321193427}, //
+
4131 {-0.154320985, -0.2530864483426}, //
+
4132 });
+
4133 polys.push_back({
+
4134 {-0.179012358, -0.2530864483428}, //
+
4135 {-0.179012358, -0.2654321193436}, //
+
4136 {-0.19135803, -0.2654321193437}, //
+
4137 {-0.19135803, -0.2530864483438}, //
+
4138 });
+
4139 polys.push_back({
+
4140 {-0.216049403, -0.3024691343432}, //
+
4141 {-0.228395075, -0.3024691343434}, //
+
4142 {-0.228395075, -0.2901234633435}, //
+
4143 {-0.216049403, -0.2901234633433}, //
+
4144 });
+
4145 polys.push_back({
+
4146 {-0.216049403, -0.2530864483439}, //
+
4147 {-0.216049403, -0.2654321193440}, //
+
4148 {-0.228395075, -0.2654321193441}, //
+
4149 {-0.228395075, -0.2530864483442}, //
+
4150 });
+
4151 polys.push_back({
+
4152 {-0.253086448, -0.4753086573443}, //
+
4153 {-0.253086448, -0.4876543283444}, //
+
4154 {-0.265432119, -0.4876543283445}, //
+
4155 {-0.265432119, -0.4753086573446}, //
+
4156 });
+
4157 polys.push_back({
+
4158 {-0.290123463, -0.4876543283447}, //
+
4159 {-0.302469134, -0.4876543283449}, //
+
4160 {-0.302469134, -0.4753086573450}, //
+
4161 {-0.290123463, -0.4753086573448}, //
+
4162 });
+
4163 polys.push_back({
+
4164 {-0.253086448, -0.4382716123451}, //
+
4165 {-0.253086448, -0.4506172843452}, //
+
4166 {-0.265432119, -0.4506172843453}, //
+
4167 {-0.265432119, -0.4382716123454}, //
+
4168 });
+
4169 polys.push_back({
+
4170 {-0.290123463, -0.4506172843455}, //
+
4171 {-0.302469134, -0.4506172843457}, //
+
4172 {-0.302469134, -0.4382716123458}, //
+
4173 {-0.290123463, -0.4382716123456}, //
+
4174 });
+
4175 polys.push_back({
+
4176 {-0.327160507, -0.4753086573459}, //
+
4177 {-0.327160507, -0.4876543283460}, //
+
4178 {-0.339506179, -0.4876543283463}, //
+
4179 {-0.339506179, -0.4753086573461}, //
+
4180 });
+
4181 polys.push_back({
+
4182 {-0.314814836, -0.4629629553462}, //
+
4183 {-0.351851881, -0.4629629553466}, //
+
4184 {-0.351851881, -0.425925913479}, //
+
4185 {-0.314814836, -0.425925913465}, //
+
4186 });
+
4187 polys.push_back({
+
4188 {-0.364197552, -0.4753086573464}, //
+
4189 {-0.364197552, -0.4876543283486}, //
+
4190 {-0.376543224, -0.4876543283487}, //
+
4191 {-0.376543224, -0.4753086573488}, //
+
4192 });
+
4193 polys.push_back({
+
4194 {-0.364197552, -0.4382716123467}, //
+
4195 {-0.364197552, -0.4506172843493}, //
+
4196 {-0.376543224, -0.4506172843494}, //
+
4197 {-0.376543224, -0.4382716123495}, //
+
4198 });
+
4199 polys.push_back({
+
4200 {-0.253086448, -0.4135802393468}, //
+
4201 {-0.265432119, -0.4135802393470}, //
+
4202 {-0.265432119, -0.4012345673471}, //
+
4203 {-0.253086448, -0.4012345673469}, //
+
4204 });
+
4205 polys.push_back({
+
4206 {-0.290123463, -0.4135802393472}, //
+
4207 {-0.302469134, -0.4135802393474}, //
+
4208 {-0.302469134, -0.4012345673475}, //
+
4209 {-0.290123463, -0.4012345673473}, //
+
4210 });
+
4211 polys.push_back({
+
4212 {-0.253086448, -0.3641975523476}, //
+
4213 {-0.253086448, -0.3765432243477}, //
+
4214 {-0.265432119, -0.3765432243478}, //
+
4215 {-0.265432119, -0.3641975523510}, //
+
4216 });
+
4217 polys.push_back({
+
4218 {-0.327160507, -0.4135802393480}, //
+
4219 {-0.339506179, -0.4135802393483}, //
+
4220 {-0.339506179, -0.4012345673482}, //
+
4221 {-0.327160507, -0.4012345673481}, //
+
4222 });
+
4223 polys.push_back({
+
4224 {-0.364197552, -0.4012345673484}, //
+
4225 {-0.364197552, -0.4135802393506}, //
+
4226 {-0.376543224, -0.4135802393507}, //
+
4227 {-0.376543224, -0.4012345673508}, //
+
4228 });
+
4229 polys.push_back({
+
4230 {-0.401234567, -0.4753086573489}, //
+
4231 {-0.401234567, -0.4876543283490}, //
+
4232 {-0.413580239, -0.4876543283492}, //
+
4233 {-0.413580239, -0.4753086573491}, //
+
4234 });
+
4235 polys.push_back({
+
4236 {-0.401234567, -0.4506172843496}, //
+
4237 {-0.413580239, -0.4506172843498}, //
+
4238 {-0.413580239, -0.4382716123499}, //
+
4239 {-0.401234567, -0.4382716123497}, //
+
4240 });
+
4241 polys.push_back({
+
4242 {-0.438271612, -0.4753086573500}, //
+
4243 {-0.438271612, -0.4876543283501}, //
+
4244 {-0.450617284, -0.4876543283502}, //
+
4245 {-0.450617284, -0.4753086573503}, //
+
4246 });
+
4247 polys.push_back({
+
4248 {-0.253086448, -0.3395061793511}, //
+
4249 {-0.265432119, -0.3395061793513}, //
+
4250 {-0.265432119, -0.3271605073514}, //
+
4251 {-0.253086448, -0.3271605073512}, //
+
4252 });
+
4253 polys.push_back({
+
4254 {-0.253086448, -0.2901234633515}, //
+
4255 {-0.253086448, -0.3024691343516}, //
+
4256 {-0.265432119, -0.3024691343517}, //
+
4257 {-0.265432119, -0.2901234633518}, //
+
4258 });
+
4259 polys.push_back({
+
4260 {-0.0308641978, -0.2283950753522}, //
+
4261 {-0.0432098769, -0.2283950753524}, //
+
4262 {-0.0432098769, -0.2160494033525}, //
+
4263 {-0.0308641978, -0.2160494033523}, //
+
4264 });
+
4265 polys.push_back({
+
4266 {-0.0308641978, -0.191358033529}, //
+
4267 {-0.0432098769, -0.191358033531}, //
+
4268 {-0.0432098769, -0.1790123583547}, //
+
4269 {-0.0308641978, -0.1790123583530}, //
+
4270 });
+
4271 polys.push_back({
+
4272 {-0.0679012388, -0.2160494033532}, //
+
4273 {-0.0679012388, -0.2283950753533}, //
+
4274 {-0.0802469179, -0.2283950753535}, //
+
4275 {-0.0802469179, -0.2160494033534}, //
+
4276 });
+
4277 polys.push_back({
+
4278 {-0.092592597, -0.2407407613536}, //
+
4279 {-0.129629642, -0.2407407613550}, //
+
4280 {-0.129629642, -0.2037037313541}, //
+
4281 {-0.092592597, -0.2037037313537}, //
+
4282 });
+
4283 polys.push_back({
+
4284 {-0.0679012388, -0.191358033538}, //
+
4285 {-0.0802469179, -0.191358033540}, //
+
4286 {-0.0802469179, -0.1790123583548}, //
+
4287 {-0.0679012388, -0.1790123583539}, //
+
4288 });
+
4289 polys.push_back({
+
4290 {-0.104938269, -0.1790123583542}, //
+
4291 {-0.104938269, -0.191358033543}, //
+
4292 {-0.117283948, -0.191358033544}, //
+
4293 {-0.117283948, -0.1790123583549}, //
+
4294 });
+
4295 polys.push_back({
+
4296 {-0.141975313, -0.2160494033551}, //
+
4297 {-0.141975313, -0.2283950753552}, //
+
4298 {-0.154320985, -0.2283950753554}, //
+
4299 {-0.154320985, -0.2160494033553}, //
+
4300 });
+
4301 polys.push_back({
+
4302 {-0.179012358, -0.2160494033555}, //
+
4303 {-0.179012358, -0.2283950753559}, //
+
4304 {-0.19135803, -0.2283950753560}, //
+
4305 {-0.19135803, -0.2160494033561}, //
+
4306 });
+
4307 polys.push_back({
+
4308 {-0.141975313, -0.191358033556}, //
+
4309 {-0.154320985, -0.191358033558}, //
+
4310 {-0.154320985, -0.1790123583566}, //
+
4311 {-0.141975313, -0.1790123583557}, //
+
4312 });
+
4313 polys.push_back({
+
4314 {0.487654328, 0.03086419783572}, //
+
4315 {0.475308657, 0.03086419783574}, //
+
4316 {0.475308657, 0.04320987693575}, //
+
4317 {0.487654328, 0.04320987693573}, //
+
4318 });
+
4319 polys.push_back({
+
4320 {0.450617284, 0.04320987693576}, //
+
4321 {0.450617284, 0.03086419783577}, //
+
4322 {0.438271612, 0.03086419783579}, //
+
4323 {0.438271612, 0.04320987693578}, //
+
4324 });
+
4325 polys.push_back({
+
4326 {0.413580239, 0.04320987693585}, //
+
4327 {0.413580239, 0.03086419783586}, //
+
4328 {0.401234567, 0.03086419783587}, //
+
4329 {0.401234567, 0.04320987693588}, //
+
4330 });
+
4331 polys.push_back({
+
4332 {0.487654328, 0.06790123883589}, //
+
4333 {0.475308657, 0.06790123883591}, //
+
4334 {0.475308657, 0.08024691793592}, //
+
4335 {0.487654328, 0.08024691793590}, //
+
4336 });
+
4337 polys.push_back({
+
4338 {0.450617284, 0.06790123883593}, //
+
4339 {0.438271612, 0.06790123883595}, //
+
4340 {0.438271612, 0.08024691793596}, //
+
4341 {0.450617284, 0.08024691793594}, //
+
4342 });
+
4343 polys.push_back({
+
4344 {0.487654328, 0.1049382693597}, //
+
4345 {0.475308657, 0.1049382693599}, //
+
4346 {0.475308657, 0.1172839483600}, //
+
4347 {0.487654328, 0.1172839483598}, //
+
4348 });
+
4349 polys.push_back({
+
4350 {0.462962955, 0.1296296423601}, //
+
4351 {0.462962955, 0.0925925973602}, //
+
4352 {0.42592591, 0.0925925973611}, //
+
4353 {0.42592591, 0.1296296423655}, //
+
4354 });
+
4355 polys.push_back({
+
4356 {0.413580239, 0.08024691793603}, //
+
4357 {0.413580239, 0.06790123883604}, //
+
4358 {0.401234567, 0.06790123883605}, //
+
4359 {0.401234567, 0.08024691793606}, //
+
4360 });
+
4361 polys.push_back({
+
4362 {0.376543224, 0.06790123883607}, //
+
4363 {0.364197552, 0.06790123883627}, //
+
4364 {0.364197552, 0.08024691793609}, //
+
4365 {0.376543224, 0.08024691793608}, //
+
4366 });
+
4367 polys.push_back({
+
4368 {0.413580239, 0.1049382693610}, //
+
4369 {0.401234567, 0.1049382693613}, //
+
4370 {0.401234567, 0.1172839483614}, //
+
4371 {0.413580239, 0.1172839483612}, //
+
4372 });
+
4373 polys.push_back({
+
4374 {0.376543224, 0.1049382693615}, //
+
4375 {0.364197552, 0.1049382693632}, //
+
4376 {0.364197552, 0.1172839483617}, //
+
4377 {0.376543224, 0.1172839483616}, //
+
4378 });
+
4379 polys.push_back({
+
4380 {0.265432119, 0.03086419783623}, //
+
4381 {0.253086448, 0.03086419783626}, //
+
4382 {0.253086448, 0.04320987693625}, //
+
4383 {0.265432119, 0.04320987693624}, //
+
4384 });
+
4385 polys.push_back({
+
4386 {0.339506179, 0.08024691793628}, //
+
4387 {0.339506179, 0.06790123883629}, //
+
4388 {0.327160507, 0.06790123883630}, //
+
4389 {0.327160507, 0.08024691793631}, //
+
4390 });
+
4391 polys.push_back({
+
4392 {0.351851851, 0.1296296423633}, //
+
4393 {0.351851851, 0.0925925973634}, //
+
4394 {0.314814806, 0.0925925973635}, //
+
4395 {0.314814806, 0.1296296423700}, //
+
4396 });
+
4397 polys.push_back({
+
4398 {0.302469134, 0.06790123883636}, //
+
4399 {0.290123463, 0.06790123883638}, //
+
4400 {0.290123463, 0.08024691793639}, //
+
4401 {0.302469134, 0.08024691793637}, //
+
4402 });
+
4403 polys.push_back({
+
4404 {0.265432119, 0.06790123883640}, //
+
4405 {0.253086448, 0.06790123883642}, //
+
4406 {0.253086448, 0.08024691793643}, //
+
4407 {0.265432119, 0.08024691793641}, //
+
4408 });
+
4409 polys.push_back({
+
4410 {0.302469134, 0.1049382693644}, //
+
4411 {0.290123463, 0.1049382693646}, //
+
4412 {0.290123463, 0.1172839483647}, //
+
4413 {0.302469134, 0.1172839483645}, //
+
4414 });
+
4415 polys.push_back({
+
4416 {0.265432119, 0.1049382693648}, //
+
4417 {0.253086448, 0.1049382693651}, //
+
4418 {0.253086448, 0.1172839483650}, //
+
4419 {0.265432119, 0.1172839483649}, //
+
4420 });
+
4421 polys.push_back({
+
4422 {0.487654328, 0.1419753133652}, //
+
4423 {0.475308657, 0.1419753133654}, //
+
4424 {0.475308657, 0.1543209853659}, //
+
4425 {0.487654328, 0.1543209853653}, //
+
4426 });
+
4427 polys.push_back({
+
4428 {0.450617284, 0.1419753133656}, //
+
4429 {0.438271612, 0.1419753133658}, //
+
4430 {0.438271612, 0.1543209853661}, //
+
4431 {0.450617284, 0.1543209853657}, //
+
4432 });
+
4433 polys.push_back({
+
4434 {0.487654328, 0.1790123583660}, //
+
4435 {0.475308657, 0.1790123583673}, //
+
4436 {0.475308657, 0.191358033674}, //
+
4437 {0.487654328, 0.191358033672}, //
+
4438 });
+
4439 polys.push_back({
+
4440 {0.450617284, 0.1790123583662}, //
+
4441 {0.438271612, 0.1790123583677}, //
+
4442 {0.438271612, 0.191358033676}, //
+
4443 {0.450617284, 0.191358033675}, //
+
4444 });
+
4445 polys.push_back({
+
4446 {0.413580239, 0.1543209853663}, //
+
4447 {0.413580239, 0.1419753133664}, //
+
4448 {0.401234567, 0.1419753133665}, //
+
4449 {0.401234567, 0.1543209853668}, //
+
4450 });
+
4451 polys.push_back({
+
4452 {0.376543224, 0.1419753133666}, //
+
4453 {0.364197552, 0.1419753133698}, //
+
4454 {0.364197552, 0.1543209853670}, //
+
4455 {0.376543224, 0.1543209853667}, //
+
4456 });
+
4457 polys.push_back({
+
4458 {0.413580239, 0.1790123583669}, //
+
4459 {0.401234567, 0.1790123583686}, //
+
4460 {0.401234567, 0.191358033687}, //
+
4461 {0.413580239, 0.191358033685}, //
+
4462 });
+
4463 polys.push_back({
+
4464 {0.376543224, 0.1790123583671}, //
+
4465 {0.364197552, 0.1790123583715}, //
+
4466 {0.364197552, 0.191358033689}, //
+
4467 {0.376543224, 0.191358033688}, //
+
4468 });
+
4469 polys.push_back({
+
4470 {0.462962955, 0.2037037163678}, //
+
4471 {0.42592591, 0.2037037163690}, //
+
4472 {0.42592591, 0.2407407463684}, //
+
4473 {0.462962955, 0.2407407463683}, //
+
4474 });
+
4475 polys.push_back({
+
4476 {0.487654328, 0.2160494033679}, //
+
4477 {0.475308657, 0.2160494033682}, //
+
4478 {0.475308657, 0.2283950753681}, //
+
4479 {0.487654328, 0.2283950753680}, //
+
4480 });
+
4481 polys.push_back({
+
4482 {0.413580239, 0.2283950753691}, //
+
4483 {0.413580239, 0.2160494033692}, //
+
4484 {0.401234567, 0.2160494033694}, //
+
4485 {0.401234567, 0.2283950753693}, //
+
4486 });
+
4487 polys.push_back({
+
4488 {0.376543224, 0.2160494033695}, //
+
4489 {0.364197552, 0.2160494033720}, //
+
4490 {0.364197552, 0.2283950753697}, //
+
4491 {0.376543224, 0.2283950753696}, //
+
4492 });
+
4493 polys.push_back({
+
4494 {0.339506179, 0.1543209853699}, //
+
4495 {0.339506179, 0.1419753133701}, //
+
4496 {0.327160507, 0.1419753133702}, //
+
4497 {0.327160507, 0.1543209853703}, //
+
4498 });
+
4499 polys.push_back({
+
4500 {0.339506179, 0.1790123583704}, //
+
4501 {0.327160507, 0.1790123583717}, //
+
4502 {0.327160507, 0.191358033718}, //
+
4503 {0.339506179, 0.191358033716}, //
+
4504 });
+
4505 polys.push_back({
+
4506 {0.302469134, 0.1419753133705}, //
+
4507 {0.290123463, 0.1419753133707}, //
+
4508 {0.290123463, 0.1543209853711}, //
+
4509 {0.302469134, 0.1543209853706}, //
+
4510 });
+
4511 polys.push_back({
+
4512 {0.265432119, 0.1419753133708}, //
+
4513 {0.253086448, 0.1419753133710}, //
+
4514 {0.253086448, 0.1543209853713}, //
+
4515 {0.265432119, 0.1543209853709}, //
+
4516 });
+
4517 polys.push_back({
+
4518 {0.302469134, 0.1790123583712}, //
+
4519 {0.290123463, 0.1790123583725}, //
+
4520 {0.290123463, 0.191358033726}, //
+
4521 {0.302469134, 0.191358033724}, //
+
4522 });
+
4523 polys.push_back({
+
4524 {0.265432119, 0.1790123583714}, //
+
4525 {0.253086448, 0.1790123583729}, //
+
4526 {0.253086448, 0.191358033728}, //
+
4527 {0.265432119, 0.191358033727}, //
+
4528 });
+
4529 polys.push_back({
+
4530 {0.351851851, 0.2037037163719}, //
+
4531 {0.314814806, 0.2037037163722}, //
+
4532 {0.314814806, 0.2407407463723}, //
+
4533 {0.351851851, 0.2407407463721}, //
+
4534 });
+
4535 polys.push_back({
+
4536 {0.302469134, 0.2160494033730}, //
+
4537 {0.290123463, 0.2160494033732}, //
+
4538 {0.290123463, 0.2283950753733}, //
+
4539 {0.302469134, 0.2283950753731}, //
+
4540 });
+
4541 polys.push_back({
+
4542 {0.265432119, 0.2160494033734}, //
+
4543 {0.253086448, 0.2160494033737}, //
+
4544 {0.253086448, 0.2283950753736}, //
+
4545 {0.265432119, 0.2283950753735}, //
+
4546 });
+
4547 polys.push_back({
+
4548 {0.228395075, 0.03086419783743}, //
+
4549 {0.216049403, 0.03086419783745}, //
+
4550 {0.216049403, 0.04320987693746}, //
+
4551 {0.228395075, 0.04320987693744}, //
+
4552 });
+
4553 polys.push_back({
+
4554 {0.19135803, 0.04320987693747}, //
+
4555 {0.19135803, 0.03086419783748}, //
+
4556 {0.179012358, 0.03086419783751}, //
+
4557 {0.179012358, 0.04320987693749}, //
+
4558 });
+
4559 polys.push_back({
+
4560 {0.228395075, 0.06790123883752}, //
+
4561 {0.216049403, 0.06790123883754}, //
+
4562 {0.216049403, 0.08024691793755}, //
+
4563 {0.228395075, 0.08024691793753}, //
+
4564 });
+
4565 polys.push_back({
+
4566 {0.19135803, 0.06790123883756}, //
+
4567 {0.179012358, 0.06790123883765}, //
+
4568 {0.179012358, 0.08024691793758}, //
+
4569 {0.19135803, 0.08024691793757}, //
+
4570 });
+
4571 polys.push_back({
+
4572 {0.240740761, 0.0925925973759}, //
+
4573 {0.203703731, 0.0925925973762}, //
+
4574 {0.203703731, 0.1296296423767}, //
+
4575 {0.240740761, 0.1296296423760}, //
+
4576 });
+
4577 polys.push_back({
+
4578 {0.19135803, 0.1049382693761}, //
+
4579 {0.179012358, 0.1049382693766}, //
+
4580 {0.179012358, 0.1172839483764}, //
+
4581 {0.19135803, 0.1172839483763}, //
+
4582 });
+
4583 polys.push_back({
+
4584 {0.228395075, 0.1419753133768}, //
+
4585 {0.216049403, 0.1419753133770}, //
+
4586 {0.216049403, 0.1543209853773}, //
+
4587 {0.228395075, 0.1543209853769}, //
+
4588 });
+
4589 polys.push_back({
+
4590 {0.19135803, 0.1419753133771}, //
+
4591 {0.179012358, 0.1419753133777}, //
+
4592 {0.179012358, 0.1543209853775}, //
+
4593 {0.19135803, 0.1543209853772}, //
+
4594 });
+
4595 polys.push_back({
+
4596 {0.228395075, 0.1790123583774}, //
+
4597 {0.216049403, 0.1790123583779}, //
+
4598 {0.216049403, 0.191358033780}, //
+
4599 {0.228395075, 0.191358033778}, //
+
4600 });
+
4601 polys.push_back({
+
4602 {0.487654328, 0.2530864483786}, //
+
4603 {0.475308657, 0.2530864483789}, //
+
4604 {0.475308657, 0.2654321193788}, //
+
4605 {0.487654328, 0.2654321193787}, //
+
4606 });
+
4607 polys.push_back({
+
4608 {0.450617284, 0.2530864483790}, //
+
4609 {0.438271612, 0.2530864483793}, //
+
4610 {0.438271612, 0.2654321193792}, //
+
4611 {0.450617284, 0.2654321193791}, //
+
4612 });
+
4613 polys.push_back({
+
4614 {0.487654328, 0.2901234633794}, //
+
4615 {0.475308657, 0.2901234633796}, //
+
4616 {0.475308657, 0.3024691343797}, //
+
4617 {0.487654328, 0.3024691343795}, //
+
4618 });
+
4619 polys.push_back({
+
4620 {0.450617284, 0.3024691343798}, //
+
4621 {0.450617284, 0.2901234633799}, //
+
4622 {0.438271612, 0.2901234633801}, //
+
4623 {0.438271612, 0.3024691343800}, //
+
4624 });
+
4625 polys.push_back({
+
4626 {0.413580239, 0.2530864483802}, //
+
4627 {0.401234567, 0.2530864483805}, //
+
4628 {0.401234567, 0.2654321193804}, //
+
4629 {0.413580239, 0.2654321193803}, //
+
4630 });
+
4631 polys.push_back({
+
4632 {0.376543224, 0.2530864483806}, //
+
4633 {0.364197552, 0.2530864483829}, //
+
4634 {0.364197552, 0.2654321193808}, //
+
4635 {0.376543224, 0.2654321193807}, //
+
4636 });
+
4637 polys.push_back({
+
4638 {0.413580239, 0.3024691343809}, //
+
4639 {0.413580239, 0.2901234633810}, //
+
4640 {0.401234567, 0.2901234633811}, //
+
4641 {0.401234567, 0.3024691343812}, //
+
4642 });
+
4643 polys.push_back({
+
4644 {0.487654328, 0.3271605073813}, //
+
4645 {0.475308657, 0.3271605073815}, //
+
4646 {0.475308657, 0.3395061793818}, //
+
4647 {0.487654328, 0.3395061793814}, //
+
4648 });
+
4649 polys.push_back({
+
4650 {0.462962955, 0.3518518813816}, //
+
4651 {0.462962955, 0.3148148363817}, //
+
4652 {0.42592591, 0.3148148363822}, //
+
4653 {0.42592591, 0.3518518813820}, //
+
4654 });
+
4655 polys.push_back({
+
4656 {0.487654328, 0.3641975523819}, //
+
4657 {0.475308657, 0.3641975523844}, //
+
4658 {0.475308657, 0.3765432243845}, //
+
4659 {0.487654328, 0.3765432243843}, //
+
4660 });
+
4661 polys.push_back({
+
4662 {0.450617284, 0.3641975523821}, //
+
4663 {0.438271612, 0.3641975523848}, //
+
4664 {0.438271612, 0.3765432243847}, //
+
4665 {0.450617284, 0.3765432243846}, //
+
4666 });
+
4667 polys.push_back({
+
4668 {0.413580239, 0.3395061793823}, //
+
4669 {0.413580239, 0.3271605073824}, //
+
4670 {0.401234567, 0.3271605073825}, //
+
4671 {0.401234567, 0.3395061793827}, //
+
4672 });
+
4673 polys.push_back({
+
4674 {0.413580239, 0.3641975523828}, //
+
4675 {0.401234567, 0.3641975523859}, //
+
4676 {0.401234567, 0.3765432243860}, //
+
4677 {0.413580239, 0.3765432243858}, //
+
4678 });
+
4679 polys.push_back({
+
4680 {0.339506179, 0.2654321193830}, //
+
4681 {0.339506179, 0.2530864483831}, //
+
4682 {0.327160507, 0.2530864483833}, //
+
4683 {0.327160507, 0.2654321193832}, //
+
4684 });
+
4685 polys.push_back({
+
4686 {0.302469134, 0.2530864483835}, //
+
4687 {0.290123463, 0.2530864483837}, //
+
4688 {0.290123463, 0.2654321193838}, //
+
4689 {0.302469134, 0.2654321193836}, //
+
4690 });
+
4691 polys.push_back({
+
4692 {0.487654328, 0.4012345673849}, //
+
4693 {0.475308657, 0.4012345673851}, //
+
4694 {0.475308657, 0.4135802393852}, //
+
4695 {0.487654328, 0.4135802393850}, //
+
4696 });
+
4697 polys.push_back({
+
4698 {0.450617284, 0.4012345673853}, //
+
4699 {0.438271612, 0.4012345673855}, //
+
4700 {0.438271612, 0.4135802393856}, //
+
4701 {0.450617284, 0.4135802393854}, //
+
4702 });
+
4703 polys.push_back({
+
4704 {0.487654328, 0.4382716123864}, //
+
4705 {0.475308657, 0.4382716123866}, //
+
4706 {0.475308657, 0.4506172843867}, //
+
4707 {0.487654328, 0.4506172843865}, //
+
4708 });
+
4709 TestPoly(polys, 1771);
+
4710}
+
4711
+
4712TEST(Polygon, Woodgrain1) {
+
4713 Polygons polys;
+
4714 polys.push_back({
+
4715 {72.5, -50}, //
+
4716 {-72.5, 50}, //
+
4717 {-72.5, -50}, //
+
4718 });
+
4719 polys.push_back({
+
4720 {27.7341537, -49.9853325}, //
+
4721 {27.4095287, -49.6340637}, //
+
4722 {27.9608383, -49.758522}, //
+
4723 });
+
4724 polys.push_back({
+
4725 {-1.56910598, -49.98423}, //
+
4726 {-1.58251643, -49.9838409}, //
+
4727 {-1.19169295, -48.0386696}, //
+
4728 {-1.02179492, -49.9855652}, //
+
4729 });
+
4730 TestPoly(polys, 12, 0.00145);
+
4731}
+
4732
+
4733TEST(Polygon, Woodgrain2) {
+
4734 Polygons polys;
+
4735 polys.push_back({
+
4736 {22.7295628, -49.5001106}, //
+
4737 {-21.1059895, -49.9855423}, //
+
4738 {-35.0938339, 10.1798563}, //
+
4739 {-72.5, -50}, //
+
4740 {-12.7149582, -50}, //
+
4741 });
+
4742 polys.push_back({
+
4743 {-40.1850586, -49.9840584}, //
+
4744 {-40.2071075, -49.9845123}, //
+
4745 {-40.3756485, -49.9855652}, //
+
4746 {-40.0327415, -19.857235}, //
+
4747 });
+
4748 TestPoly(polys, 9, 0.00145);
+
4749}
+
+
+ + + + diff --git a/docs/html/public_8h_source.html b/docs/html/public_8h_source.html new file mode 100644 index 000000000..4eb9616fc --- /dev/null +++ b/docs/html/public_8h_source.html @@ -0,0 +1,683 @@ + + + + + + + +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_ENABLE_EXPERIMENTAL // needed for glm/gtx/compatibility.hpp
+
17#define GLM_FORCE_EXPLICIT_CTOR
+
18#include <glm/ext/matrix_transform.hpp>
+
19#include <glm/glm.hpp>
+
20#include <glm/gtc/constants.hpp>
+
21#include <glm/gtx/compatibility.hpp>
+
22#include <glm/gtx/rotate_vector.hpp>
+
23#include <limits>
+
24#include <memory>
+
25#include <unordered_map>
+
26#include <vector>
+
27
+
28#ifdef MANIFOLD_DEBUG
+
29#include <iomanip>
+
30#include <iostream>
+
31#include <sstream>
+
32#endif
+
33
+
34constexpr std::size_t operator""_z(unsigned long long n) { return n; }
+
35
+
36namespace manifold {
+
37
+
38constexpr float kTolerance = 1e-5;
+
39
+
+
50inline float sind(float x) {
+
51 if (!std::isfinite(x)) return sin(x);
+
52 if (x < 0.0f) return -sind(-x);
+
53 int quo;
+
54 x = remquo(fabs(x), 90.0f, &quo);
+
55 switch (quo % 4) {
+
56 case 0:
+
57 return sin(glm::radians(x));
+
58 case 1:
+
59 return cos(glm::radians(x));
+
60 case 2:
+
61 return -sin(glm::radians(x));
+
62 case 3:
+
63 return -cos(glm::radians(x));
+
64 }
+
65 return 0.0f;
+
66}
+
+
67
+
73inline float cosd(float x) { return sind(x + 90.0f); }
+
74
+
+
81inline glm::mat4x3 RotateUp(glm::vec3 up) {
+
82 up = glm::normalize(up);
+
83 glm::vec3 axis = glm::cross(up, {0, 0, 1});
+
84 float angle = glm::asin(glm::length(axis));
+
85 if (glm::dot(up, {0, 0, 1}) < 0) angle = glm::pi<float>() - angle;
+
86 return glm::mat4x3(glm::rotate(glm::mat4(1), angle, axis));
+
87}
+
+
88
+
+
100inline int CCW(glm::vec2 p0, glm::vec2 p1, glm::vec2 p2, float tol) {
+
101 glm::vec2 v1 = p1 - p0;
+
102 glm::vec2 v2 = p2 - p0;
+
103 float area = v1.x * v2.y - v1.y * v2.x;
+
104 float base2 = glm::max(glm::dot(v1, v1), glm::dot(v2, v2));
+
105 if (area * area * 4 <= base2 * tol * tol)
+
106 return 0;
+
107 else
+
108 return area > 0 ? 1 : -1;
+
109}
+
+
110
+
116using SimplePolygon = std::vector<glm::vec2>;
+
117
+
124using Polygons = std::vector<SimplePolygon>;
+
125
+
+
129struct Mesh {
+
131 std::vector<glm::vec3> vertPos;
+
134 std::vector<glm::ivec3> triVerts;
+
138 std::vector<glm::vec3> vertNormal;
+
143 std::vector<glm::vec4> halfedgeTangent;
+
148 float precision = 0;
+
149};
+
+
150
+
+ + + +
162};
+
+
163
+
+ +
168 float surfaceArea, volume;
+
169};
+
+
170
+
+
171struct Box {
+
172 glm::vec3 min = glm::vec3(std::numeric_limits<float>::infinity());
+
173 glm::vec3 max = glm::vec3(-std::numeric_limits<float>::infinity());
+
174
+
178 Box() {}
+
179
+
+
183 Box(const glm::vec3 p1, const glm::vec3 p2) {
+
184 min = glm::min(p1, p2);
+
185 max = glm::max(p1, p2);
+
186 }
+
+
187
+
191 glm::vec3 Size() const { return max - min; }
+
192
+
196 glm::vec3 Center() const { return 0.5f * (max + min); }
+
197
+
+
202 float Scale() const {
+
203 glm::vec3 absMax = glm::max(glm::abs(min), glm::abs(max));
+
204 return glm::max(absMax.x, glm::max(absMax.y, absMax.z));
+
205 }
+
+
206
+
+
210 bool Contains(const glm::vec3& p) const {
+
211 return glm::all(glm::greaterThanEqual(p, min)) &&
+
212 glm::all(glm::greaterThanEqual(max, p));
+
213 }
+
+
214
+
+
218 bool Contains(const Box& box) const {
+
219 return glm::all(glm::greaterThanEqual(box.min, min)) &&
+
220 glm::all(glm::greaterThanEqual(max, box.max));
+
221 }
+
+
222
+
+
226 void Union(const glm::vec3 p) {
+
227 min = glm::min(min, p);
+
228 max = glm::max(max, p);
+
229 }
+
+
230
+
+
234 Box Union(const Box& box) const {
+
235 Box out;
+
236 out.min = glm::min(min, box.min);
+
237 out.max = glm::max(max, box.max);
+
238 return out;
+
239 }
+
+
240
+
+
248 Box Transform(const glm::mat4x3& transform) const {
+
249 Box out;
+
250 glm::vec3 minT = transform * glm::vec4(min, 1.0f);
+
251 glm::vec3 maxT = transform * glm::vec4(max, 1.0f);
+
252 out.min = glm::min(minT, maxT);
+
253 out.max = glm::max(minT, maxT);
+
254 return out;
+
255 }
+
+
256
+
+
260 Box operator+(glm::vec3 shift) const {
+
261 Box out;
+
262 out.min = min + shift;
+
263 out.max = max + shift;
+
264 return out;
+
265 }
+
+
266
+
+
270 Box& operator+=(glm::vec3 shift) {
+
271 min += shift;
+
272 max += shift;
+
273 return *this;
+
274 }
+
+
275
+
+
279 Box operator*(glm::vec3 scale) const {
+
280 Box out;
+
281 out.min = min * scale;
+
282 out.max = max * scale;
+
283 return out;
+
284 }
+
+
285
+
+
289 Box& operator*=(glm::vec3 scale) {
+
290 min *= scale;
+
291 max *= scale;
+
292 return *this;
+
293 }
+
+
294
+
+
298 inline bool DoesOverlap(const Box& box) const {
+
299 return min.x <= box.max.x && min.y <= box.max.y && min.z <= box.max.z &&
+
300 max.x >= box.min.x && max.y >= box.min.y && max.z >= box.min.z;
+
301 }
+
+
302
+
+
307 inline bool DoesOverlap(glm::vec3 p) const { // projected in z
+
308 return p.x <= max.x && p.x >= min.x && p.y <= max.y && p.y >= min.y;
+
309 }
+
+
310
+
+
314 bool IsFinite() const {
+
315 return glm::all(glm::isfinite(min)) && glm::all(glm::isfinite(max));
+
316 }
+
+
317};
+
+
318
+
+
322struct Rect {
+
323 glm::vec2 min = glm::vec2(std::numeric_limits<float>::infinity());
+
324 glm::vec2 max = glm::vec2(-std::numeric_limits<float>::infinity());
+
325
+
329 Rect() {}
+
330
+
+
334 Rect(const glm::vec2 a, const glm::vec2 b) {
+
335 min = glm::min(a, b);
+
336 max = glm::max(a, b);
+
337 }
+
+
338
+
343
+
347 glm::vec2 Size() const { return max - min; }
+
348
+
+
352 float Area() const {
+
353 auto sz = Size();
+
354 return sz.x * sz.y;
+
355 }
+
+
356
+
+
361 float Scale() const {
+
362 glm::vec2 absMax = glm::max(glm::abs(min), glm::abs(max));
+
363 return glm::max(absMax.x, absMax.y);
+
364 }
+
+
365
+
369 glm::vec2 Center() const { return 0.5f * (max + min); }
+
370
+
+
374 bool Contains(const glm::vec2& p) const {
+
375 return glm::all(glm::greaterThanEqual(p, min)) &&
+
376 glm::all(glm::greaterThanEqual(max, p));
+
377 }
+
+
378
+
+
382 bool Contains(const Rect& rect) const {
+
383 return glm::all(glm::greaterThanEqual(rect.min, min)) &&
+
384 glm::all(glm::greaterThanEqual(max, rect.max));
+
385 }
+
+
386
+
+
390 bool DoesOverlap(const Rect& rect) const {
+
391 return min.x <= rect.max.x && min.y <= rect.max.y && max.x >= rect.min.x &&
+
392 max.y >= rect.min.y;
+
393 }
+
+
394
+
398 bool IsEmpty() const { return max.y <= min.y || max.x <= min.x; };
+
399
+
+
403 bool IsFinite() const {
+
404 return glm::all(glm::isfinite(min)) && glm::all(glm::isfinite(max));
+
405 }
+
+
406
+
408
+
412
+
+
416 void Union(const glm::vec2 p) {
+
417 min = glm::min(min, p);
+
418 max = glm::max(max, p);
+
419 }
+
+
420
+
+
424 Rect Union(const Rect& rect) const {
+
425 Rect out;
+
426 out.min = glm::min(min, rect.min);
+
427 out.max = glm::max(max, rect.max);
+
428 return out;
+
429 }
+
+
430
+
+
434 Rect operator+(const glm::vec2 shift) const {
+
435 Rect out;
+
436 out.min = min + shift;
+
437 out.max = max + shift;
+
438 return out;
+
439 }
+
+
440
+
+
444 Rect& operator+=(const glm::vec2 shift) {
+
445 min += shift;
+
446 max += shift;
+
447 return *this;
+
448 }
+
+
449
+
+
453 Rect operator*(const glm::vec2 scale) const {
+
454 Rect out;
+
455 out.min = min * scale;
+
456 out.max = max * scale;
+
457 return out;
+
458 }
+
+
459
+
+
463 Rect& operator*=(const glm::vec2 scale) {
+
464 min *= scale;
+
465 max *= scale;
+
466 return *this;
+
467 }
+
+
468
+
+
476 Rect Transform(const glm::mat3x2& m) const {
+
477 Rect rect;
+
478 rect.min = m * glm::vec3(min, 1);
+
479 rect.max = m * glm::vec3(max, 1);
+
480 return rect;
+
481 }
+
+
483};
+
+
493enum class OpType { Add, Subtract, Intersect };
+
494
+
+
503class Quality {
+
504 private:
+
505 inline static int circularSegments_ = 0;
+
506 inline static float circularAngle_ = 10.0f;
+
507 inline static float circularEdgeLength_ = 1.0f;
+
508
+
509 public:
+
+
520 static void SetMinCircularAngle(float angle) {
+
521 if (angle <= 0) return;
+
522 circularAngle_ = angle;
+
523 }
+
+
524
+
+
534 static void SetMinCircularEdgeLength(float length) {
+
535 if (length <= 0) return;
+
536 circularEdgeLength_ = length;
+
537 }
+
+
538
+
+
548 static void SetCircularSegments(int number) {
+
549 if (number < 3 && number != 0) return;
+
550 circularSegments_ = number;
+
551 }
+
+
552
+
+
560 static int GetCircularSegments(float radius) {
+
561 if (circularSegments_ > 0) return circularSegments_;
+
562 int nSegA = 360.0f / circularAngle_;
+
563 int nSegL = 2.0f * radius * glm::pi<float>() / circularEdgeLength_;
+
564 int nSeg = fmin(nSegA, nSegL) + 3;
+
565 nSeg -= nSeg % 4;
+
566 return std::max(nSeg, 3);
+
567 }
+
+
568};
+
+
586#ifdef MANIFOLD_DEBUG
+
+
587struct userErr : public virtual std::runtime_error {
+
588 using std::runtime_error::runtime_error;
+
589};
+
+
+
590struct topologyErr : public virtual std::runtime_error {
+
591 using std::runtime_error::runtime_error;
+
592};
+
+
+
593struct geometryErr : public virtual std::runtime_error {
+
594 using std::runtime_error::runtime_error;
+
595};
+
+
596using logicErr = std::logic_error;
+
597#endif
+
+ +
607 bool intermediateChecks = false;
+
610 bool verbose = false;
+
613 bool processOverlaps = true;
+
616 bool suppressErrors = false;
+
618 bool deterministic = false;
+
620 bool cleanupTriangles = true;
+
621};
+
+
622
+
623#ifdef MANIFOLD_DEBUG
+
624
+
625template <typename T>
+
626inline std::ostream& operator<<(std::ostream& stream, const glm::tvec2<T>& v) {
+
627 return stream << "x = " << v.x << ", y = " << v.y;
+
628}
+
629
+
630template <typename T>
+
631inline std::ostream& operator<<(std::ostream& stream, const glm::tvec3<T>& v) {
+
632 return stream << "x = " << v.x << ", y = " << v.y << ", z = " << v.z;
+
633}
+
634
+
635template <typename T>
+
636inline std::ostream& operator<<(std::ostream& stream, const glm::tvec4<T>& v) {
+
637 return stream << "x = " << v.x << ", y = " << v.y << ", z = " << v.z
+
638 << ", w = " << v.w;
+
639}
+
640
+
641inline std::ostream& operator<<(std::ostream& stream, const glm::mat3& mat) {
+
642 glm::mat3 tam = glm::transpose(mat);
+
643 return stream << tam[0] << std::endl
+
644 << tam[1] << std::endl
+
645 << tam[2] << std::endl;
+
646}
+
647
+
648inline std::ostream& operator<<(std::ostream& stream, const glm::mat4x3& mat) {
+
649 glm::mat3x4 tam = glm::transpose(mat);
+
650 return stream << tam[0] << std::endl
+
651 << tam[1] << std::endl
+
652 << tam[2] << std::endl;
+
653}
+
654
+
655inline std::ostream& operator<<(std::ostream& stream, const Box& box) {
+
656 return stream << "min: " << box.min << ", "
+
657 << "max: " << box.max;
+
658}
+
659
+
660inline std::ostream& operator<<(std::ostream& stream, const Rect& box) {
+
661 return stream << "min: " << box.min << ", "
+
662 << "max: " << box.max;
+
663}
+
664
+
669template <typename T>
+
+
670void Dump(const std::vector<T>& vec) {
+
671 std::cout << "Vec = " << std::endl;
+
672 for (int i = 0; i < vec.size(); ++i) {
+
673 std::cout << i << ", " << vec[i] << ", " << std::endl;
+
674 }
+
675 std::cout << std::endl;
+
676}
+
+
677
+
678template <typename T>
+
679void Diff(const std::vector<T>& a, const std::vector<T>& b) {
+
680 std::cout << "Diff = " << std::endl;
+
681 if (a.size() != b.size()) {
+
682 std::cout << "a and b must have the same length, aborting Diff"
+
683 << std::endl;
+
684 return;
+
685 }
+
686 for (int i = 0; i < a.size(); ++i) {
+
687 if (a[i] != b[i])
+
688 std::cout << i << ": " << a[i] << ", " << b[i] << std::endl;
+
689 }
+
690 std::cout << std::endl;
+
691}
+
693#endif
+
694} // namespace manifold
+
695
+
696#undef HOST_DEVICE
+
Definition public.h:503
+
static void SetMinCircularAngle(float angle)
Definition public.h:520
+
static void SetMinCircularEdgeLength(float length)
Definition public.h:534
+
static void SetCircularSegments(int number)
Definition public.h:548
+
static int GetCircularSegments(float radius)
Definition public.h:560
+
Definition vec_view.h:27
+
std::vector< glm::ivec3 > triVerts
Definition public.h:134
+
std::vector< glm::vec4 > halfedgeTangent
Definition public.h:143
+
float smoothness
Definition public.h:161
+
std::vector< glm::vec3 > vertNormal
Definition public.h:138
+
int halfedge
The halfedge index = 3 * tri + i, referring to Mesh.triVerts[tri][i].
Definition public.h:157
+
std::vector< glm::vec3 > vertPos
Required: The X-Y-Z positions of all vertices.
Definition public.h:131
+
float precision
Definition public.h:148
+
int CCW(glm::vec2 p0, glm::vec2 p1, glm::vec2 p2, float tol)
Definition public.h:100
+
float cosd(float x)
Definition public.h:73
+
std::vector< glm::vec2 > SimplePolygon
Definition public.h:116
+
std::vector< SimplePolygon > Polygons
Definition public.h:124
+
glm::mat4x3 RotateUp(glm::vec3 up)
Definition public.h:81
+
float sind(float x)
Definition public.h:50
+
Definition public.h:129
+
Definition public.h:167
+
Definition public.h:155
+
OpType
Definition public.h:493
+
bool deterministic
Deterministic outputs. Will disable some parallel optimizations.
Definition public.h:618
+
bool suppressErrors
Definition public.h:616
+
bool processOverlaps
Definition public.h:613
+
bool cleanupTriangles
Perform optional but recommended triangle cleanups in SimplifyTopology()
Definition public.h:620
+
bool verbose
Definition public.h:610
+
bool intermediateChecks
Definition public.h:607
+
void Dump(const std::vector< T > &vec)
Definition public.h:670
+
Definition public.h:604
+
Definition meshIO.h:20
+
Definition public.h:171
+
bool DoesOverlap(glm::vec3 p) const
Definition public.h:307
+
bool Contains(const glm::vec3 &p) const
Definition public.h:210
+
bool IsFinite() const
Definition public.h:314
+
bool DoesOverlap(const Box &box) const
Definition public.h:298
+
Box(const glm::vec3 p1, const glm::vec3 p2)
Definition public.h:183
+
Box operator*(glm::vec3 scale) const
Definition public.h:279
+
Box Transform(const glm::mat4x3 &transform) const
Definition public.h:248
+
Box Union(const Box &box) const
Definition public.h:234
+
Box & operator+=(glm::vec3 shift)
Definition public.h:270
+
glm::vec3 Center() const
Definition public.h:196
+
void Union(const glm::vec3 p)
Definition public.h:226
+
float Scale() const
Definition public.h:202
+
Box()
Definition public.h:178
+
glm::vec3 Size() const
Definition public.h:191
+
Box & operator*=(glm::vec3 scale)
Definition public.h:289
+
Box operator+(glm::vec3 shift) const
Definition public.h:260
+
bool Contains(const Box &box) const
Definition public.h:218
+
Definition public.h:322
+
Rect(const glm::vec2 a, const glm::vec2 b)
Definition public.h:334
+
glm::vec2 Center() const
Definition public.h:369
+
float Area() const
Definition public.h:352
+
glm::vec2 Size() const
Definition public.h:347
+
Rect operator*(const glm::vec2 scale) const
Definition public.h:453
+
bool IsFinite() const
Definition public.h:403
+
bool Contains(const glm::vec2 &p) const
Definition public.h:374
+
Rect operator+(const glm::vec2 shift) const
Definition public.h:434
+
Rect Transform(const glm::mat3x2 &m) const
Definition public.h:476
+
Rect & operator+=(const glm::vec2 shift)
Definition public.h:444
+
bool IsEmpty() const
Definition public.h:398
+
Rect Union(const Rect &rect) const
Definition public.h:424
+
float Scale() const
Definition public.h:361
+
bool Contains(const Rect &rect) const
Definition public.h:382
+
Rect()
Definition public.h:329
+
bool DoesOverlap(const Rect &rect) const
Definition public.h:390
+
Rect & operator*=(const glm::vec2 scale)
Definition public.h:463
+
void Union(const glm::vec2 p)
Definition public.h:416
+
Definition public.h:593
+
Definition public.h:590
+
Definition public.h:587
+
+
+ + + + diff --git a/docs/html/rect_8cpp_source.html b/docs/html/rect_8cpp_source.html new file mode 100644 index 000000000..51633bc74 --- /dev/null +++ b/docs/html/rect_8cpp_source.html @@ -0,0 +1,217 @@ + + + + + + + +Manifold: rect.cpp Source File + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
rect.cpp
+
+
+
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 "conv.h"
+
16#include "cross_section.h"
+
17#include "manifold.h"
+
18#include "public.h"
+
19#include "types.h"
+
20
+
21ManifoldRect *manifold_rect(void *mem, float x1, float y1, float x2, float y2) {
+
22 auto p1 = glm::vec2(x1, y1);
+
23 auto p2 = glm::vec2(x2, y2);
+
24 auto rect = new (mem) Rect(p1, p2);
+
25 return to_c(rect);
+
26}
+
27
+
28ManifoldVec2 manifold_rect_min(ManifoldRect *r) {
+
29 return to_c((*from_c(r)).min);
+
30}
+
31
+
32ManifoldVec2 manifold_rect_max(ManifoldRect *r) {
+
33 return to_c((*from_c(r)).max);
+
34}
+
35
+
36ManifoldVec2 manifold_rect_dimensions(ManifoldRect *r) {
+
37 auto v = from_c(r)->Size();
+
38 return {v.x, v.y};
+
39}
+
40
+
41ManifoldVec2 manifold_rect_center(ManifoldRect *r) {
+
42 auto v = from_c(r)->Center();
+
43 return {v.x, v.y};
+
44}
+
45
+
46float manifold_rect_scale(ManifoldRect *r) { return from_c(r)->Scale(); }
+
47
+
48int manifold_rect_contains_pt(ManifoldRect *r, float x, float y) {
+
49 auto rect = *from_c(r);
+
50 auto p = glm::vec2(x, y);
+
51 return rect.Contains(p);
+
52}
+
53
+
54int manifold_rect_contains_rect(ManifoldRect *a, ManifoldRect *b) {
+
55 auto outer = *from_c(a);
+
56 auto inner = *from_c(b);
+
57 return outer.Contains(inner);
+
58}
+
59
+
60void manifold_rect_include_pt(ManifoldRect *r, float x, float y) {
+
61 auto rect = *from_c(r);
+
62 auto p = glm::vec2(x, y);
+
63 rect.Union(p);
+
64}
+
65
+
66ManifoldRect *manifold_rect_union(void *mem, ManifoldRect *a, ManifoldRect *b) {
+
67 auto rect = from_c(a)->Union(*from_c(b));
+
68 return to_c(new (mem) Rect(rect));
+
69}
+
70
+
71ManifoldRect *manifold_rect_transform(void *mem, ManifoldRect *r, float x1,
+
72 float y1, float x2, float y2, float x3,
+
73 float y3) {
+
74 auto mat = glm::mat3x2(x1, y1, x2, y2, x3, y3);
+
75 auto transformed = from_c(r)->Transform(mat);
+
76 return to_c(new (mem) Rect(transformed));
+
77}
+
78
+
79ManifoldRect *manifold_rect_translate(void *mem, ManifoldRect *r, float x,
+
80 float y) {
+
81 auto rect = *from_c(r);
+
82 auto p = glm::vec2(x, y);
+
83 auto translated = (*from_c(r)) + p;
+
84 return to_c(new (mem) Rect(translated));
+
85}
+
86
+
87ManifoldRect *manifold_rect_mul(void *mem, ManifoldRect *r, float x, float y) {
+
88 auto rect = *from_c(r);
+
89 auto p = glm::vec2(x, y);
+
90 auto scaled = (*from_c(r)) * p;
+
91 return to_c(new (mem) Rect(scaled));
+
92}
+
93
+
94int manifold_rect_does_overlap_rect(ManifoldRect *a, ManifoldRect *r) {
+
95 return from_c(a)->DoesOverlap(*from_c(r));
+
96}
+
97
+
98int manifold_rect_is_empty(ManifoldRect *r) { return from_c(r)->IsEmpty(); }
+
99
+
100int manifold_rect_is_finite(ManifoldRect *r) { return from_c(r)->IsFinite(); }
+
Manifold Transform(const glm::mat4x3 &) const
Definition manifold.cpp:537
+
bool IsEmpty() const
Definition manifold.cpp:355
+
Manifold Scale(glm::vec3) const
Definition manifold.cpp:509
+
Definition types.h:43
+
Definition public.h:322
+
+
+ + + + 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..488cff9ba --- /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..2c70e31de --- /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:305
+
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..ac6b8bd5f --- /dev/null +++ b/docs/html/search/all_0.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['1vxrfyhpshzgubl9tewzceovlpxrpq5j5_20usp_20sharing_20python_20colab_20example_20a_0',['<a href="https://colab.research.google.com/drive/1VxrFYHPSHZgUbl9TeWzCeovlpXrPQ5J5?usp=sharing" >Python Colab Example</a>',['..//github/workspace/README.md#autotoc_md19',1,'']]] +]; diff --git a/docs/html/search/all_1.js b/docs/html/search/all_1.js new file mode 100644 index 000000000..51a7d1d3f --- /dev/null +++ b/docs/html/search/all_1.js @@ -0,0 +1,11 @@ +var searchData= +[ + ['a_20href_20https_3a_20colab_20research_20google_20com_20drive_201vxrfyhpshzgubl9tewzceovlpxrpq5j5_20usp_20sharing_20python_20colab_20example_20a_0',['<a href="https://colab.research.google.com/drive/1VxrFYHPSHZgUbl9TeWzCeovlpXrPQ5J5?usp=sharing" >Python Colab Example</a>',['..//github/workspace/README.md#autotoc_md19',1,'']]], + ['a_20href_20https_3a_20manifoldcad_20org_20manifoldcad_20org_20a_1',['a href https: manifoldcad org manifoldcad org a',['..//github/workspace/bindings/wasm/README.md#autotoc_md6',1,'<a href="https://manifoldcad.org" >ManifoldCAD.org</a>'],['..//github/workspace/README.md#autotoc_md18',1,'<a href="https://manifoldcad.org" >ManifoldCAD.org</a>']]], + ['about_20the_20author_2',['about the author',['..//github/workspace/bindings/wasm/README.md#autotoc_md11',1,'About the author'],['..//github/workspace/README.md#autotoc_md31',1,'About the author']]], + ['agreement_3',['Contributor License Agreement',['../md__c_o_n_t_r_i_b_u_t_i_n_g.html#autotoc_md13',1,'']]], + ['area_4',['area',['../classmanifold_1_1_cross_section.html#ac84b151a969c68d662637e8245548666',1,'manifold::CrossSection::Area()'],['../structmanifold_1_1_rect.html#a10d5618fa11db90402e29c30fbf50096',1,'manifold::Rect::Area()']]], + ['asoriginal_5',['AsOriginal',['../classmanifold_1_1_manifold.html#a9b4bbbc5b70a0d1f6b07c91f1684fb57',1,'manifold::Manifold']]], + ['author_6',['author',['..//github/workspace/bindings/wasm/README.md#autotoc_md11',1,'About the author'],['..//github/workspace/README.md#autotoc_md31',1,'About the author']]], + ['autogenerated_20doc_20strings_7',['Autogenerated Doc-Strings',['../index.html#autotoc_md1',1,'']]] +]; diff --git a/docs/html/search/all_10.js b/docs/html/search/all_10.js new file mode 100644 index 000000000..6ef66f21f --- /dev/null +++ b/docs/html/search/all_10.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['quality_0',['Quality',['../classmanifold_1_1_quality.html',1,'manifold']]] +]; diff --git a/docs/html/search/all_11.js b/docs/html/search/all_11.js new file mode 100644 index 000000000..88e8153f7 --- /dev/null +++ b/docs/html/search/all_11.js @@ -0,0 +1,23 @@ +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']]], + ['refinetolength_2',['RefineToLength',['../classmanifold_1_1_manifold.html#a4fa475bc00e8b7a8fe28eea6b2d0e69e',1,'manifold::Manifold']]], + ['reindexedge_3',['ReindexEdge',['../structmanifold_1_1_reindex_edge.html',1,'manifold']]], + ['reindexverts_4',['ReindexVerts',['../structmanifold_1_1_manifold_1_1_impl.html#a9c45d5f57ab940c4a2682d6f11fdab40',1,'manifold::Manifold::Impl']]], + ['relation_5',['Relation',['../structmanifold_1_1_manifold_1_1_impl.html#structmanifold_1_1_manifold_1_1_impl_1_1_relation',1,'manifold::Manifold::Impl']]], + ['release_5fchecklist_6',['RELEASE_CHECKLIST',['../md__r_e_l_e_a_s_e___c_h_e_c_k_l_i_s_t.html',1,'']]], + ['research_20google_20com_20drive_201vxrfyhpshzgubl9tewzceovlpxrpq5j5_20usp_20sharing_20python_20colab_20example_20a_7',['<a href="https://colab.research.google.com/drive/1VxrFYHPSHZgUbl9TeWzCeovlpXrPQ5J5?usp=sharing" >Python Colab Example</a>',['..//github/workspace/README.md#autotoc_md19',1,'']]], + ['reserveids_8',['ReserveIDs',['../classmanifold_1_1_manifold.html#a1d7e7e674ce7bd9954dc0d54ec6ebc8c',1,'manifold::Manifold']]], + ['reviews_9',['Code Reviews',['../md__c_o_n_t_r_i_b_u_t_i_n_g.html#autotoc_md14',1,'']]], + ['revolve_10',['Revolve',['../classmanifold_1_1_manifold.html#aaf8fa0b43477e935d650c2f774d76c85',1,'manifold::Manifold']]], + ['rotate_11',['rotate',['../classmanifold_1_1_cross_section.html#a95da829a99ea68c24170525e849e7dc4',1,'manifold::CrossSection::Rotate()'],['../classmanifold_1_1_manifold.html#a54569c8da01e3385a426011a40a60629',1,'manifold::Manifold::Rotate()']]], + ['rotateup_12',['RotateUp',['../group___connections.html#ga8997efa1e8a2c5fcc69314c863a8b6da',1,'manifold']]], + ['roughness_13',['roughness',['../group___mesh_i_o.html#a2c76422d3e436164284a7dba0b8a9cc4',1,'manifold::Material']]], + ['round_14',['Round',['../classmanifold_1_1_cross_section.html#aef400c43b34e3ecc3f7b342aa821395dab7f41fc1412ad2ee75e9b2635d3b9d5c',1,'manifold::CrossSection']]], + ['roundedframe_15',['RoundedFrame',['../group___samples.html#ga8d224b44ea69ea070ebad60e6c1abbb9',1,'manifold']]], + ['run_5fall_16',['run_all',['../namespacerun__all.html',1,'']]], + ['runindex_17',['runIndex',['../structmanifold_1_1_mesh_g_l.html#a0a53d3053354c6a80b1164f4e87c3ab4',1,'manifold::MeshGL']]], + ['runoriginalid_18',['runOriginalID',['../structmanifold_1_1_mesh_g_l.html#aa67d01a9b240154a754945eca9fca3e0',1,'manifold::MeshGL']]], + ['runtransform_19',['runTransform',['../structmanifold_1_1_mesh_g_l.html#a2ea55ea45b4bd7ec973dcf2973abaa20',1,'manifold::MeshGL']]] +]; diff --git a/docs/html/search/all_12.js b/docs/html/search/all_12.js new file mode 100644 index 000000000..b8e666724 --- /dev/null +++ b/docs/html/search/all_12.js @@ -0,0 +1,46 @@ +var searchData= +[ + ['s_20here_0',['s here',['..//github/workspace/README.md#autotoc_md21',1,'What's here'],['..//github/workspace/bindings/wasm/README.md#autotoc_md8',1,'What's here']]], + ['samples_1',['Samples',['../group___samples.html',1,'']]], + ['sandboxes_2',['Manifold Frontend Sandboxes',['..//github/workspace/README.md#autotoc_md17',1,'']]], + ['scale_3',['scale',['../classmanifold_1_1_cross_section.html#af181324d8998fd89fa7a3e8bc7ef905c',1,'manifold::CrossSection::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()']]], + ['scallop_4',['scallop',['../group___samples.html#ga45f5b5c2a374a8c67d9208a2bf9acc36',1,'manifold::Scallop()'],['../namespacescallop.html',1,'scallop']]], + ['setcircularsegments_5',['SetCircularSegments',['../classmanifold_1_1_quality.html#a6b80d08df8a58d699ce644e1248fe0e2',1,'manifold::Quality']]], + ['setmincircularangle_6',['SetMinCircularAngle',['../classmanifold_1_1_quality.html#a17d90e845a2c75a0ef859e3ec5363a9e',1,'manifold::Quality']]], + ['setmincircularedgelength_7',['SetMinCircularEdgeLength',['../classmanifold_1_1_quality.html#a6a3a5a1105d40f044f777f0e3c14506a',1,'manifold::Quality']]], + ['setnormals_8',['SetNormals',['../structmanifold_1_1_manifold_1_1_impl.html#a47e442af7d6655edf6dfef50cb958210',1,'manifold::Manifold::Impl']]], + ['setprecision_9',['SetPrecision',['../structmanifold_1_1_manifold_1_1_impl.html#a32981853ceaf771ca541df5b5c6e085b',1,'manifold::Manifold::Impl']]], + ['setproperties_10',['SetProperties',['../classmanifold_1_1_manifold.html#a1aaf5a6d1a3d8c22f1a2c57a653cc389',1,'manifold::Manifold']]], + ['sharedptrguard_11',['SharedPtrGuard',['../classmanifold_1_1_concurrent_shared_ptr_1_1_shared_ptr_guard.html',1,'manifold::ConcurrentSharedPtr']]], + ['sharing_20python_20colab_20example_20a_12',['<a href="https://colab.research.google.com/drive/1VxrFYHPSHZgUbl9TeWzCeovlpXrPQ5J5?usp=sharing" >Python Colab Example</a>',['..//github/workspace/README.md#autotoc_md19',1,'']]], + ['shenanigans_13',['Windows Shenanigans',['..//github/workspace/README.md#autotoc_md26',1,'']]], + ['simplepolygon_14',['SimplePolygon',['../group___connections.html#ga53c298f15c33cb04ef759cec45eaecd1',1,'manifold']]], + ['simplify_15',['Simplify',['../classmanifold_1_1_cross_section.html#aa46f202c1b92251f77fd497dc8fd9daf',1,'manifold::CrossSection']]], + ['simplifytopology_16',['SimplifyTopology',['../structmanifold_1_1_manifold_1_1_impl.html#a5814bb78c6aee8506a332d6cacf76af7',1,'manifold::Manifold::Impl']]], + ['sind_17',['sind',['../group___connections.html#gaf191247f966a40ecf3ee0fe9a717c0f3',1,'manifold']]], + ['size_18',['size',['../structmanifold_1_1_box.html#adedb961e2415f91bef56c5ca13e1e651',1,'manifold::Box::Size()'],['../structmanifold_1_1_rect.html#a232479a21f63dd4e6868cdedec53fa71',1,'manifold::Rect::Size()']]], + ['slice_19',['Slice',['../classmanifold_1_1_manifold.html#a8e75e8acf7a0cc2ef5cbe7c13a047c6a',1,'manifold::Manifold']]], + ['smooth_20',['smooth',['../classmanifold_1_1_manifold.html#aff03aac40d42a60f8e4254db90530c83',1,'manifold::Manifold::Smooth(const MeshGL &, const std::vector< Smoothness > &sharpenedEdges={})'],['../classmanifold_1_1_manifold.html#aad322c5b69ab571a4f4fb5b26f945b90',1,'manifold::Manifold::Smooth(const Mesh &, const std::vector< Smoothness > &sharpenedEdges={})']]], + ['smoothbynormals_21',['SmoothByNormals',['../classmanifold_1_1_manifold.html#aa0cbb9710c375f40591c3ae2dd62f2b4',1,'manifold::Manifold']]], + ['smoothness_22',['smoothness',['../group___connections.html#structmanifold_1_1_smoothness',1,'Smoothness'],['../group___connections.html#a6ebfae52291cc3b6f4e25043eaf14381',1,'manifold::Smoothness::smoothness']]], + ['smoothout_23',['SmoothOut',['../classmanifold_1_1_manifold.html#a8ce7d02b7f16afb5e9bfb8a948e206d3',1,'manifold::Manifold']]], + ['sortfaces_24',['SortFaces',['../structmanifold_1_1_manifold_1_1_impl.html#a9c6ad8be3b98a1f83c7d9a7df1f983c8',1,'manifold::Manifold::Impl']]], + ['sortverts_25',['SortVerts',['../structmanifold_1_1_manifold_1_1_impl.html#a960f240018111751cf0a91339a1d1b08',1,'manifold::Manifold::Impl']]], + ['sparseindices_26',['SparseIndices',['../classmanifold_1_1_sparse_indices.html',1,'manifold']]], + ['spectralnorm_27',['SpectralNorm',['../group___connections.html#ga50a9d6292886da472798354447a68cd7',1,'manifold']]], + ['sphere_28',['Sphere',['../classmanifold_1_1_manifold.html#a1fa0a21aed71099905b89a10bcde0539',1,'manifold::Manifold']]], + ['split_29',['Split',['../classmanifold_1_1_manifold.html#a60e241b8a56d334b3d2d3dbd2fc808ba',1,'manifold::Manifold']]], + ['split_5fcube_30',['split_cube',['../namespacesplit__cube.html',1,'']]], + ['splitbyplane_31',['SplitByPlane',['../classmanifold_1_1_manifold.html#adc134d7a6dfbf8c74e5d531bbeb330cb',1,'manifold::Manifold']]], + ['square_32',['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_33',['Status',['../classmanifold_1_1_manifold.html#a423e2f2a67ccc0662a97e018b2c3886d',1,'manifold::Manifold']]], + ['stretchybracelet_34',['StretchyBracelet',['../group___samples.html#gaa093ef8b44f049141ccbaca556f88cd3',1,'manifold']]], + ['stride_5ffunctor_35',['stride_functor',['../structmanifold_1_1strided__range_1_1stride__functor.html',1,'manifold::strided_range']]], + ['strided_5frange_36',['strided_range',['../classmanifold_1_1strided__range.html',1,'manifold']]], + ['strings_37',['Autogenerated Doc-Strings',['../index.html#autotoc_md1',1,'']]], + ['subdivide_38',['Subdivide',['../structmanifold_1_1_manifold_1_1_impl.html#abe4f5b3c2e601eb17c121dfd6c755445',1,'manifold::Manifold::Impl']]], + ['support_39',['Fuzzing Support',['..//github/workspace/README.md#autotoc_md30',1,'']]], + ['suppresserrors_40',['suppressErrors',['../group___debug.html#a48b673772893c29c426e98f8c84f0206',1,'manifold::ExecutionParams']]], + ['svd_41',['SVD',['../group___connections.html#ga52654eb696e6ea2b67dcd45063d1724a',1,'manifold']]], + ['svdset_42',['SVDSet',['../group___connections.html#structmanifold_1_1_s_v_d_set',1,'manifold']]] +]; diff --git a/docs/html/search/all_13.js b/docs/html/search/all_13.js new file mode 100644 index 000000000..f534b7cfb --- /dev/null +++ b/docs/html/search/all_13.js @@ -0,0 +1,25 @@ +var searchData= +[ + ['tetpuzzle_0',['TetPuzzle',['../group___samples.html#ga49162c3a42d672758d14855ad23258b9',1,'manifold']]], + ['tetrahedron_1',['Tetrahedron',['../classmanifold_1_1_manifold.html#afbd42733f05fb87dec1b3dae9ff9f582',1,'manifold::Manifold']]], + ['the_20author_2',['the author',['..//github/workspace/README.md#autotoc_md31',1,'About the author'],['..//github/workspace/bindings/wasm/README.md#autotoc_md11',1,'About the author']]], + ['timer_3',['Timer',['../structmanifold_1_1_timer.html',1,'manifold']]], + ['tmpedge_4',['TmpEdge',['../structmanifold_1_1_tmp_edge.html',1,'manifold']]], + ['tmpinvalid_5',['TmpInvalid',['../structmanifold_1_1_tmp_invalid.html',1,'manifold']]], + ['to_20contribute_6',['How to Contribute',['../md__c_o_n_t_r_i_b_u_t_i_n_g.html',1,'']]], + ['topologyerr_7',['topologyErr',['../structmanifold_1_1topology_err.html',1,'manifold']]], + ['topolygons_8',['ToPolygons',['../classmanifold_1_1_cross_section.html#a209a83b1c39a84e094da9e854a7b8bc2',1,'manifold::CrossSection']]], + ['torusknot_9',['TorusKnot',['../group___samples.html#ga1937d6fee956f401ad9a3c9c2dc6eae2',1,'manifold']]], + ['transform_10',['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_11',['translate',['../classmanifold_1_1_manifold.html#ac1ebb85b775a3293bca68c2339762a08',1,'manifold::Manifold::Translate()'],['../classmanifold_1_1_cross_section.html#a106b1c0c300c4820cd9f5ec2f683a0db',1,'manifold::CrossSection::Translate()']]], + ['tri_12',['tri',['../structmanifold_1_1_tri_ref.html#a15e0e24263c3a2cc742b9cfcbabedf88',1,'manifold::TriRef']]], + ['triangulate_13',['Triangulate',['../group___connections.html#ga1d01ff53289da0842e539ddf8cda5c96',1,'manifold']]], + ['triangulateidx_14',['TriangulateIdx',['../group___private.html#ga1e0bedc58e58ed72b02b49addf999b85',1,'manifold']]], + ['trimbyplane_15',['TrimByPlane',['../classmanifold_1_1_manifold.html#a1b711341093c115f6688cbcaae5c8741',1,'manifold::Manifold']]], + ['triref_16',['TriRef',['../structmanifold_1_1_tri_ref.html',1,'manifold']]], + ['triverts_17',['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_3amat_3c_20c_2c_20r_2c_20t_2c_20q_20_3e_20_3e_18',['type_caster< glm::mat< C, R, T, Q > >',['../structnb_1_1detail_1_1type__caster_3_01glm_1_1mat_3_01_c_00_01_r_00_01_t_00_01_q_01_4_01_4.html',1,'nb::detail']]], + ['type_5fcaster_3c_20glm_3a_3avec_3c_20n_2c_20t_2c_20q_20_3e_20_3e_19',['type_caster< glm::vec< N, T, Q > >',['../structnb_1_1detail_1_1type__caster_3_01glm_1_1vec_3_01_n_00_01_t_00_01_q_01_4_01_4.html',1,'nb::detail']]], + ['type_5fcaster_3c_20manifold_3a_3avecview_3c_20glm_3a_3avec_3c_20n_2c_20t_2c_20q_20_3e_20_3e_20_3e_20',['type_caster< manifold::VecView< glm::vec< N, T, Q > > >',['../structnb_1_1detail_1_1type__caster_3_01manifold_1_1_vec_view_3_01glm_1_1vec_3_01_n_00_01_t_00_01_q_01_4_01_4_01_4.html',1,'nb::detail']]], + ['type_5fcaster_3c_20std_3a_3avector_3c_20glm_3a_3avec_3c_20n_2c_20t_2c_20q_20_3e_20_3e_20_3e_21',['type_caster< std::vector< glm::vec< N, T, Q > > >',['../structnb_1_1detail_1_1type__caster_3_01std_1_1vector_3_01glm_1_1vec_3_01_n_00_01_t_00_01_q_01_4_01_4_01_4.html',1,'nb::detail']]] +]; diff --git a/docs/html/search/all_14.js b/docs/html/search/all_14.js new file mode 100644 index 000000000..04d46e5c4 --- /dev/null +++ b/docs/html/search/all_14.js @@ -0,0 +1,10 @@ +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']]], + ['users_5',['users',['..//github/workspace/bindings/wasm/examples/README.md#autotoc_md5',1,'Note for firefox users'],['..//github/workspace/README.md#autotoc_md16',1,'Users']]], + ['usp_20sharing_20python_20colab_20example_20a_6',['<a href="https://colab.research.google.com/drive/1VxrFYHPSHZgUbl9TeWzCeovlpXrPQ5J5?usp=sharing" >Python Colab Example</a>',['..//github/workspace/README.md#autotoc_md19',1,'']]] +]; diff --git a/docs/html/search/all_15.js b/docs/html/search/all_15.js new file mode 100644 index 000000000..24e0259d6 --- /dev/null +++ b/docs/html/search/all_15.js @@ -0,0 +1,38 @@ +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_20uint64_20_3e_11',['Vec< Uint64 >',['../classmanifold_1_1_vec.html',1,'manifold']]], + ['vec_3c_20unsigned_20char_20_3e_12',['Vec< unsigned char >',['../classmanifold_1_1_vec.html',1,'manifold']]], + ['vec_3c_20v_20_3e_13',['Vec< V >',['../classmanifold_1_1_vec.html',1,'manifold']]], + ['vecview_14',['VecView',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20char_20_3e_15',['VecView< char >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20const_20manifold_3a_3atmpedge_20_3e_16',['VecView< const manifold::TmpEdge >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20float_20_3e_17',['VecView< float >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20glm_3a_3aivec3_20_3e_18',['VecView< glm::ivec3 >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20glm_3a_3avec3_20_3e_19',['VecView< glm::vec3 >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20glm_3a_3avec4_20_3e_20',['VecView< glm::vec4 >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20int_20_3e_21',['VecView< int >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20manifold_3a_3abox_20_3e_22',['VecView< manifold::Box >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20manifold_3a_3ahalfedge_20_3e_23',['VecView< manifold::Halfedge >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20manifold_3a_3atriref_20_3e_24',['VecView< manifold::TriRef >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20thrust_3a_3apair_3c_20int_2c_20int_20_3e_20_3e_25',['VecView< thrust::pair< int, int > >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20uint64_20_3e_26',['VecView< Uint64 >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20unsigned_20char_20_3e_27',['VecView< unsigned char >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20v_20_3e_28',['VecView< V >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['verbose_29',['verbose',['../group___debug.html#ab3f078684998b83967d507d0f453f454',1,'manifold::ExecutionParams']]], + ['vertcolor_30',['vertColor',['../group___mesh_i_o.html#ad7e76077d824291218e32c0bdea9d3ff',1,'manifold::Material']]], + ['vertexcollisionsz_31',['VertexCollisionsZ',['../structmanifold_1_1_manifold_1_1_impl.html#afdc4c1c73cab15b3a13853d04fee567a',1,'manifold::Manifold::Impl']]], + ['vertnormal_32',['vertNormal',['../group___connections.html#a7e3e35f7f7302164b545e6ea8e7cc6a6',1,'manifold::Mesh']]], + ['vertpos_33',['vertPos',['../group___connections.html#abe99befaf9804cdadc31f0233bf4827a',1,'manifold::Mesh']]], + ['vertproperties_34',['vertProperties',['../structmanifold_1_1_mesh_g_l.html#aa4312e60a8b813c1ceb0e4229a993983',1,'manifold::MeshGL']]] +]; diff --git a/docs/html/search/all_16.js b/docs/html/search/all_16.js new file mode 100644 index 000000000..64ceef07a --- /dev/null +++ b/docs/html/search/all_16.js @@ -0,0 +1,8 @@ +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()']]], + ['warpbatch_1',['warpbatch',['../classmanifold_1_1_cross_section.html#ae004e45467f97624c89465248f4ffda1',1,'manifold::CrossSection::WarpBatch()'],['../classmanifold_1_1_manifold.html#a76546a15aa48f9a9064e7bfc7792c302',1,'manifold::Manifold::WarpBatch()']]], + ['wasm_2',['WASM',['..//github/workspace/README.md#autotoc_md23',1,'']]], + ['what_20s_20here_3',['what s here',['..//github/workspace/bindings/wasm/README.md#autotoc_md8',1,'What's here'],['..//github/workspace/README.md#autotoc_md21',1,'What's here']]], + ['windows_20shenanigans_4',['Windows Shenanigans',['..//github/workspace/README.md#autotoc_md26',1,'']]] +]; diff --git a/docs/html/search/all_2.js b/docs/html/search/all_2.js new file mode 100644 index 000000000..ec859ba3a --- /dev/null +++ b/docs/html/search/all_2.js @@ -0,0 +1,13 @@ +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::BatchBoolean()'],['../classmanifold_1_1_manifold.html#a1b30c42e224bda7e71a3ed3cf02319c1',1,'manifold::Manifold::BatchBoolean()']]], + ['bindings_2',['Python Bindings',['../index.html',1,'']]], + ['boolean_3',['boolean',['../classmanifold_1_1_cross_section.html#a05734d6b0b1fb38d56865b9c73c806f2',1,'manifold::CrossSection::Boolean()'],['../classmanifold_1_1_manifold.html#a9aad9d9b9a58ff2b7622de673742d1df',1,'manifold::Manifold::Boolean()']]], + ['boolean3_4',['Boolean3',['../classmanifold_1_1_boolean3.html',1,'manifold']]], + ['boundingbox_5',['BoundingBox',['../classmanifold_1_1_manifold.html#a3d711d458596b520edd4cd7948a53e67',1,'manifold::Manifold']]], + ['bounds_6',['Bounds',['../classmanifold_1_1_cross_section.html#ae69af2b193a98c4adc6f613a7463482c',1,'manifold::CrossSection']]], + ['box_7',['box',['../structmanifold_1_1_box.html',1,'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)']]], + ['bricks_8',['bricks',['../namespacebricks.html',1,'']]], + ['building_9',['Building',['..//github/workspace/README.md#autotoc_md22',1,'']]] +]; diff --git a/docs/html/search/all_3.js b/docs/html/search/all_3.js new file mode 100644 index 000000000..c789f2744 --- /dev/null +++ b/docs/html/search/all_3.js @@ -0,0 +1,41 @@ +var searchData= +[ + ['calculatebbox_0',['CalculateBBox',['../structmanifold_1_1_manifold_1_1_impl.html#a4bad2940552ae5f952d4b1f710627a25',1,'manifold::Manifold::Impl']]], + ['calculatecurvature_1',['CalculateCurvature',['../classmanifold_1_1_manifold.html#a19abb297f7b7b43f5c84562bcc7df705',1,'manifold::Manifold']]], + ['calculatenormals_2',['calculatenormals',['../structmanifold_1_1_manifold_1_1_impl.html#adef45f00696640f682ede12311bdace7',1,'manifold::Manifold::Impl::CalculateNormals()'],['../classmanifold_1_1_manifold.html#a69c1ea423ea019bb932e3f55d3f6ff50',1,'manifold::Manifold::CalculateNormals()']]], + ['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']]], + ['clojure_7',['Java / Clojure',['..//github/workspace/README.md#autotoc_md25',1,'']]], + ['code_20reviews_8',['Code Reviews',['../md__c_o_n_t_r_i_b_u_t_i_n_g.html#autotoc_md14',1,'']]], + ['colab_20example_20a_9',['<a href="https://colab.research.google.com/drive/1VxrFYHPSHZgUbl9TeWzCeovlpXrPQ5J5?usp=sharing" >Python Colab Example</a>',['..//github/workspace/README.md#autotoc_md19',1,'']]], + ['colab_20research_20google_20com_20drive_201vxrfyhpshzgubl9tewzceovlpxrpq5j5_20usp_20sharing_20python_20colab_20example_20a_10',['<a href="https://colab.research.google.com/drive/1VxrFYHPSHZgUbl9TeWzCeovlpXrPQ5J5?usp=sharing" >Python Colab Example</a>',['..//github/workspace/README.md#autotoc_md19',1,'']]], + ['collider_11',['collider',['../classmanifold_1_1_collider.html#a669c441365fc439e52cd655edd70856d',1,'manifold::Collider::Collider()'],['../classmanifold_1_1_collider.html',1,'Collider']]], + ['collisions_12',['Collisions',['../classmanifold_1_1_collider.html#a46782d8a38157f8011b0ecf273345739',1,'manifold::Collider']]], + ['color_13',['color',['../group___mesh_i_o.html#af3f2d7fd6f40d5dd418aef858956a49b',1,'manifold::Material']]], + ['colorchannels_14',['colorChannels',['../group___mesh_i_o.html#a0cb39f4007172ad6c0d647c9d0a5a4c7',1,'manifold::Material']]], + ['com_20drive_201vxrfyhpshzgubl9tewzceovlpxrpq5j5_20usp_20sharing_20python_20colab_20example_20a_15',['<a href="https://colab.research.google.com/drive/1VxrFYHPSHZgUbl9TeWzCeovlpXrPQ5J5?usp=sharing" >Python Colab Example</a>',['..//github/workspace/README.md#autotoc_md19',1,'']]], + ['community_20guidelines_16',['Community Guidelines',['../md__c_o_n_t_r_i_b_u_t_i_n_g.html#autotoc_md15',1,'']]], + ['compactprops_17',['CompactProps',['../structmanifold_1_1_manifold_1_1_impl.html#af327697359fb97021fbdcdd0d53b471a',1,'manifold::Manifold::Impl']]], + ['compose_18',['compose',['../classmanifold_1_1_cross_section.html#a6eb6f97b4b0c4ac7bfeb79dc1234e8f3',1,'manifold::CrossSection::Compose()'],['../classmanifold_1_1_manifold.html#a96a1b20e25443713304db55196573e3d',1,'manifold::Manifold::Compose()'],['../classmanifold_1_1_csg_leaf_node.html#ac78f0bab130bd5e2cddeb9fed4c149ed',1,'manifold::CsgLeafNode::Compose()']]], + ['concurrentsharedptr_19',['ConcurrentSharedPtr',['../classmanifold_1_1_concurrent_shared_ptr.html',1,'manifold']]], + ['concurrentsharedptr_3c_20impl_20_3e_20',['ConcurrentSharedPtr< Impl >',['../classmanifold_1_1_concurrent_shared_ptr.html',1,'manifold']]], + ['connections_21',['Connections',['../group___connections.html',1,'']]], + ['contains_22',['contains',['../structmanifold_1_1_box.html#afddd3d24795d0c760ae8a458ead93b0d',1,'manifold::Box::Contains(const Box &box) const'],['../structmanifold_1_1_box.html#a1aa1ea08f35a830ecc80b2bc83c9bcce',1,'manifold::Box::Contains(const glm::vec3 &p) const'],['../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']]], + ['contribute_23',['How to Contribute',['../md__c_o_n_t_r_i_b_u_t_i_n_g.html',1,'']]], + ['contributing_24',['Contributing',['..//github/workspace/README.md#autotoc_md27',1,'']]], + ['contributor_20license_20agreement_25',['Contributor License Agreement',['../md__c_o_n_t_r_i_b_u_t_i_n_g.html#autotoc_md13',1,'']]], + ['core_26',['Core',['../group___core.html',1,'']]], + ['cosd_27',['cosd',['../group___connections.html#ga502f5a841d8d1fcba289e167a1177bda',1,'manifold']]], + ['createhalfedges_28',['CreateHalfedges',['../structmanifold_1_1_manifold_1_1_impl.html#aff973f757a74082c8fc75b0f8054557d',1,'manifold::Manifold::Impl']]], + ['createtangents_29',['createtangents',['../structmanifold_1_1_manifold_1_1_impl.html#ace17948374ae1178c45e661c1b95cc8b',1,'manifold::Manifold::Impl::CreateTangents(std::vector< Smoothness >)'],['../structmanifold_1_1_manifold_1_1_impl.html#acc962337837219c991a414bf4033ef61',1,'manifold::Manifold::Impl::CreateTangents(int normalIdx)']]], + ['crosssection_30',['crosssection',['../classmanifold_1_1_cross_section.html#ad2f60f6e1e3d45e773a595a1be246cf2',1,'manifold::CrossSection::CrossSection(const Rect &rect)'],['../classmanifold_1_1_cross_section.html#a885334a617ae0eea9402f74a20f4408e',1,'manifold::CrossSection::CrossSection(const Polygons &contours, FillRule fillrule=FillRule::Positive)'],['../classmanifold_1_1_cross_section.html#aca5659d6e02ee4583791b54285d682a2',1,'manifold::CrossSection::CrossSection(const SimplePolygon &contour, FillRule fillrule=FillRule::Positive)'],['../classmanifold_1_1_cross_section.html#ada3a36554c48080ae963a9628de79436',1,'manifold::CrossSection::CrossSection(const CrossSection &other)'],['../classmanifold_1_1_cross_section.html#acbed403d82ee8d55f3be2c9a5f963ec0',1,'manifold::CrossSection::CrossSection()'],['../classmanifold_1_1_cross_section.html',1,'CrossSection']]], + ['csgleafnode_31',['CsgLeafNode',['../classmanifold_1_1_csg_leaf_node.html',1,'manifold']]], + ['csgnode_32',['CsgNode',['../classmanifold_1_1_csg_node.html',1,'manifold']]], + ['csgopnode_33',['CsgOpNode',['../classmanifold_1_1_csg_op_node.html',1,'manifold']]], + ['cube_34',['Cube',['../classmanifold_1_1_manifold.html#a42a229536f08603883f7bf6329de589b',1,'manifold::Manifold']]], + ['cube_5fwith_5fdents_35',['cube_with_dents',['../namespacecube__with__dents.html',1,'']]], + ['cubevoid_36',['CubeVoid',['../struct_cube_void.html',1,'']]], + ['cylinder_37',['Cylinder',['../classmanifold_1_1_manifold.html#ad13bd5caab7cb2ad363be98066b93a68',1,'manifold::Manifold']]] +]; diff --git a/docs/html/search/all_4.js b/docs/html/search/all_4.js new file mode 100644 index 000000000..7e806bcca --- /dev/null +++ b/docs/html/search/all_4.js @@ -0,0 +1,12 @@ +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']]], + ['development_3',['Local development',['..//github/workspace/bindings/wasm/examples/README.md#autotoc_md4',1,'']]], + ['distancetriangletrianglesquared_4',['DistanceTriangleTriangleSquared',['../namespacemanifold.html#af8fb0f066f81a72edd0d91c2e1957329',1,'manifold']]], + ['doc_20strings_5',['Autogenerated Doc-Strings',['../index.html#autotoc_md1',1,'']]], + ['doesoverlap_6',['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()']]], + ['drive_201vxrfyhpshzgubl9tewzceovlpxrpq5j5_20usp_20sharing_20python_20colab_20example_20a_7',['<a href="https://colab.research.google.com/drive/1VxrFYHPSHZgUbl9TeWzCeovlpXrPQ5J5?usp=sharing" >Python Colab Example</a>',['..//github/workspace/README.md#autotoc_md19',1,'']]], + ['dump_8',['Dump',['../group___debug.html#ga5a4ed9a6d64edb22079ff7a5caddcb5a',1,'manifold']]] +]; diff --git a/docs/html/search/all_5.js b/docs/html/search/all_5.js new file mode 100644 index 000000000..2986f03f6 --- /dev/null +++ b/docs/html/search/all_5.js @@ -0,0 +1,14 @@ +var searchData= +[ + ['edge_0',['Edge',['../struct_edge.html',1,'']]], + ['edgecollisions_1',['EdgeCollisions',['../structmanifold_1_1_manifold_1_1_impl.html#afed30f82c409a32c13e68079a5b366a5',1,'manifold::Manifold::Impl']]], + ['edgeedgedist_2',['EdgeEdgeDist',['../namespacemanifold.html#ad1d9e7b62d9b78d53b339584180bd79c',1,'manifold']]], + ['evenodd_3',['EvenOdd',['../classmanifold_1_1_cross_section.html#a9a534b0377c9ca41983d53b0dae0d5a4a8e586e4bd2c45e86222301f2e6e0e390',1,'manifold::CrossSection']]], + ['example_20a_4',['<a href="https://colab.research.google.com/drive/1VxrFYHPSHZgUbl9TeWzCeovlpXrPQ5J5?usp=sharing" >Python Colab Example</a>',['..//github/workspace/README.md#autotoc_md19',1,'']]], + ['examples_5',['Examples',['..//github/workspace/bindings/wasm/README.md#autotoc_md10',1,'']]], + ['exceptions_6',['Exceptions',['../group___exceptions.html',1,'']]], + ['executionparams_7',['ExecutionParams',['../group___debug.html#structmanifold_1_1_execution_params',1,'manifold']]], + ['exportmesh_8',['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_9',['ExportOptions',['../group___mesh_i_o.html#structmanifold_1_1_export_options',1,'manifold']]], + ['extrude_10',['Extrude',['../classmanifold_1_1_manifold.html#ac7c16cfa9564e2af5367105ed4016763',1,'manifold::Manifold']]] +]; diff --git a/docs/html/search/all_6.js b/docs/html/search/all_6.js new file mode 100644 index 000000000..acce9c13d --- /dev/null +++ b/docs/html/search/all_6.js @@ -0,0 +1,15 @@ +var searchData= +[ + ['face2polygons_0',['Face2Polygons',['../structmanifold_1_1_manifold_1_1_impl.html#ae2e222860f6cfa46e1c0e270d26f5976',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']]], + ['firefox_20users_6',['Note for firefox users',['..//github/workspace/bindings/wasm/examples/README.md#autotoc_md5',1,'']]], + ['firstnonfinite_7',['firstNonFinite',['../structmanifold_1_1_sparse_indices_1_1first_non_finite.html',1,'manifold::SparseIndices']]], + ['for_20firefox_20users_8',['Note for firefox users',['..//github/workspace/bindings/wasm/examples/README.md#autotoc_md5',1,'']]], + ['formatting_9',['Formatting',['..//github/workspace/README.md#autotoc_md28',1,'']]], + ['frontend_20sandboxes_10',['Manifold Frontend Sandboxes',['..//github/workspace/README.md#autotoc_md17',1,'']]], + ['fuzzing_20support_11',['Fuzzing Support',['..//github/workspace/README.md#autotoc_md30',1,'']]] +]; diff --git a/docs/html/search/all_7.js b/docs/html/search/all_7.js new file mode 100644 index 000000000..2861aa4aa --- /dev/null +++ b/docs/html/search/all_7.js @@ -0,0 +1,23 @@ +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']]], + ['glm_5fname_9',['glm_name',['../structglm__name.html',1,'']]], + ['glm_5fname_3c_20glm_3a_3aivec3_20_3e_10',['glm_name< glm::ivec3 >',['../structglm__name_3_01glm_1_1ivec3_01_4.html',1,'']]], + ['glm_5fname_3c_20glm_3a_3amat3x2_20_3e_11',['glm_name< glm::mat3x2 >',['../structglm__name_3_01glm_1_1mat3x2_01_4.html',1,'']]], + ['glm_5fname_3c_20glm_3a_3amat4x3_20_3e_12',['glm_name< glm::mat4x3 >',['../structglm__name_3_01glm_1_1mat4x3_01_4.html',1,'']]], + ['glm_5fname_3c_20glm_3a_3avec2_20_3e_13',['glm_name< glm::vec2 >',['../structglm__name_3_01glm_1_1vec2_01_4.html',1,'']]], + ['glm_5fname_3c_20glm_3a_3avec3_20_3e_14',['glm_name< glm::vec3 >',['../structglm__name_3_01glm_1_1vec3_01_4.html',1,'']]], + ['google_20com_20drive_201vxrfyhpshzgubl9tewzceovlpxrpq5j5_20usp_20sharing_20python_20colab_20example_20a_15',['<a href="https://colab.research.google.com/drive/1VxrFYHPSHZgUbl9TeWzCeovlpXrPQ5J5?usp=sharing" >Python Colab Example</a>',['..//github/workspace/README.md#autotoc_md19',1,'']]], + ['guidelines_16',['Community Guidelines',['../md__c_o_n_t_r_i_b_u_t_i_n_g.html#autotoc_md15',1,'']]], + ['gyroid_5fmodule_17',['gyroid_module',['../namespacegyroid__module.html',1,'']]], + ['gyroidmodule_18',['GyroidModule',['../group___samples.html#ga0a03a270aa7eff0866996c7abca5b0f0',1,'manifold']]], + ['gyroidsdf_19',['GyroidSDF',['../struct_gyroid_s_d_f.html',1,'']]] +]; diff --git a/docs/html/search/all_8.js b/docs/html/search/all_8.js new file mode 100644 index 000000000..cefc314b2 --- /dev/null +++ b/docs/html/search/all_8.js @@ -0,0 +1,17 @@ +var searchData= +[ + ['halfedge_0',['halfedge',['../group___connections.html#a92b70d1d84a0bf7e23f384f939dc426f',1,'manifold::Smoothness::halfedge'],['../structmanifold_1_1_halfedge.html',1,'Halfedge']]], + ['halfedge2tmp_1',['Halfedge2Tmp',['../structmanifold_1_1_halfedge2_tmp.html',1,'manifold']]], + ['halfedgetangent_2',['halfedgetangent',['../structmanifold_1_1_mesh_g_l.html#a387df8d12d2307639b862c30efa7e5c5',1,'manifold::MeshGL::halfedgeTangent'],['../group___connections.html#a496f746871d5d54cf13f1935b0e4fc66',1,'manifold::Mesh::halfedgeTangent']]], + ['hash_3c_20glm_3a_3aivec3_20_3e_3',['hash< glm::ivec3 >',['../structstd_1_1hash_3_01glm_1_1ivec3_01_4.html',1,'std']]], + ['hash_3c_20std_3a_3apair_3c_20int_2c_20int_20_3e_20_3e_4',['hash< std::pair< int, int > >',['../structstd_1_1hash_3_01std_1_1pair_3_01int_00_01int_01_4_01_4.html',1,'std']]], + ['hashtable_5',['HashTable',['../classmanifold_1_1_hash_table.html',1,'manifold']]], + ['hashtabled_6',['HashTableD',['../classmanifold_1_1_hash_table_d.html',1,'manifold']]], + ['here_7',['here',['..//github/workspace/README.md#autotoc_md21',1,'What's here'],['..//github/workspace/bindings/wasm/README.md#autotoc_md8',1,'What's here']]], + ['how_20to_20contribute_8',['How to Contribute',['../md__c_o_n_t_r_i_b_u_t_i_n_g.html',1,'']]], + ['href_20https_3a_20colab_20research_20google_20com_20drive_201vxrfyhpshzgubl9tewzceovlpxrpq5j5_20usp_20sharing_20python_20colab_20example_20a_9',['<a href="https://colab.research.google.com/drive/1VxrFYHPSHZgUbl9TeWzCeovlpXrPQ5J5?usp=sharing" >Python Colab Example</a>',['..//github/workspace/README.md#autotoc_md19',1,'']]], + ['href_20https_3a_20manifoldcad_20org_20manifoldcad_20org_20a_10',['href https: manifoldcad org manifoldcad org a',['..//github/workspace/bindings/wasm/README.md#autotoc_md6',1,'<a href="https://manifoldcad.org" >ManifoldCAD.org</a>'],['..//github/workspace/README.md#autotoc_md18',1,'<a href="https://manifoldcad.org" >ManifoldCAD.org</a>']]], + ['https_3a_20colab_20research_20google_20com_20drive_201vxrfyhpshzgubl9tewzceovlpxrpq5j5_20usp_20sharing_20python_20colab_20example_20a_11',['<a href="https://colab.research.google.com/drive/1VxrFYHPSHZgUbl9TeWzCeovlpXrPQ5J5?usp=sharing" >Python Colab Example</a>',['..//github/workspace/README.md#autotoc_md19',1,'']]], + ['https_3a_20manifoldcad_20org_20manifoldcad_20org_20a_12',['https: manifoldcad org manifoldcad org a',['..//github/workspace/bindings/wasm/README.md#autotoc_md6',1,'<a href="https://manifoldcad.org" >ManifoldCAD.org</a>'],['..//github/workspace/README.md#autotoc_md18',1,'<a href="https://manifoldcad.org" >ManifoldCAD.org</a>']]], + ['hull_13',['hull',['../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)'],['../classmanifold_1_1_cross_section.html#a49d6309921d09ab4e9874f1987f3b487',1,'manifold::CrossSection::Hull(const std::vector< CrossSection > &crossSections)'],['../classmanifold_1_1_cross_section.html#aa5ea1caf54ddac72d939a00d13763ace',1,'manifold::CrossSection::Hull() const']]] +]; diff --git a/docs/html/search/all_9.js b/docs/html/search/all_9.js new file mode 100644 index 000000000..9e2a4037c --- /dev/null +++ b/docs/html/search/all_9.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',1,'Manifold::Impl'],['../structmanifold_1_1_manifold_1_1_impl.html#ab7abcb084ad024cb903caa4e4715f713',1,'manifold::Manifold::Impl::Impl(Shape, const glm::mat4x3=glm::mat4x3(1))'],['../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_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_a.js b/docs/html/search/all_a.js new file mode 100644 index 000000000..388049bf6 --- /dev/null +++ b/docs/html/search/all_a.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['java_20clojure_0',['Java / Clojure',['..//github/workspace/README.md#autotoc_md25',1,'']]], + ['jointype_1',['JoinType',['../classmanifold_1_1_cross_section.html#aef400c43b34e3ecc3f7b342aa821395d',1,'manifold::CrossSection']]] +]; diff --git a/docs/html/search/all_b.js b/docs/html/search/all_b.js new file mode 100644 index 000000000..b7182d037 --- /dev/null +++ b/docs/html/search/all_b.js @@ -0,0 +1,7 @@ +var searchData= +[ + ['layers_0',['Layers',['../struct_layers.html',1,'']]], + ['levelset_1',['LevelSet',['../group___core.html#ga7e9804ea4f23462a8a8bdec4fb826a73',1,'manifold']]], + ['license_20agreement_2',['Contributor License Agreement',['../md__c_o_n_t_r_i_b_u_t_i_n_g.html#autotoc_md13',1,'']]], + ['local_20development_3',['Local development',['..//github/workspace/bindings/wasm/examples/README.md#autotoc_md4',1,'']]] +]; diff --git a/docs/html/search/all_c.js b/docs/html/search/all_c.js new file mode 100644 index 000000000..4eb6abf3e --- /dev/null +++ b/docs/html/search/all_c.js @@ -0,0 +1,33 @@ +var searchData= +[ + ['management_0',['Note on memory management',['..//github/workspace/bindings/wasm/README.md#autotoc_md9',1,'']]], + ['manifold_1',['manifold',['../classmanifold_1_1_manifold.html',1,'Manifold'],['..//github/workspace/README.md#autotoc_md20',1,'Manifold'],['..//github/workspace/bindings/wasm/README.md#autotoc_md7',1,'Manifold'],['../classmanifold_1_1_manifold.html#a3f761d66cf1aa619203bb7622a5f93ea',1,'manifold::Manifold::Manifold(const Mesh &)'],['../classmanifold_1_1_manifold.html#a4bc17f3828311b81bf61c34805501599',1,'manifold::Manifold::Manifold(const MeshGL &, const std::vector< float > &propertyTolerance={})'],['../namespacemanifold.html',1,'manifold'],['../classmanifold_1_1_manifold.html#ad5f60691d05e3402630122740cdf3a0b',1,'manifold::Manifold::Manifold()']]], + ['manifold_20frontend_20sandboxes_2',['Manifold Frontend Sandboxes',['..//github/workspace/README.md#autotoc_md17',1,'']]], + ['manifoldcad_20org_20a_3',['manifoldcad org a',['..//github/workspace/README.md#autotoc_md18',1,'<a href="https://manifoldcad.org" >ManifoldCAD.org</a>'],['..//github/workspace/bindings/wasm/README.md#autotoc_md6',1,'<a href="https://manifoldcad.org" >ManifoldCAD.org</a>']]], + ['manifoldcad_20org_20manifoldcad_20org_20a_4',['manifoldcad org manifoldcad org a',['..//github/workspace/README.md#autotoc_md18',1,'<a href="https://manifoldcad.org" >ManifoldCAD.org</a>'],['..//github/workspace/bindings/wasm/README.md#autotoc_md6',1,'<a href="https://manifoldcad.org" >ManifoldCAD.org</a>']]], + ['manifoldivec3_5',['ManifoldIVec3',['../struct_manifold_i_vec3.html',1,'']]], + ['manifoldmanifoldpair_6',['ManifoldManifoldPair',['../struct_manifold_manifold_pair.html',1,'']]], + ['manifoldparams_7',['ManifoldParams',['../group___debug.html#ga4a00dd8e8dff2c4f8a9105d1a5558275',1,'manifold']]], + ['manifoldproperties_8',['ManifoldProperties',['../struct_manifold_properties.html',1,'']]], + ['manifoldvec2_9',['ManifoldVec2',['../struct_manifold_vec2.html',1,'']]], + ['manifoldvec3_10',['ManifoldVec3',['../struct_manifold_vec3.html',1,'']]], + ['manifoldvec4_11',['ManifoldVec4',['../struct_manifold_vec4.html',1,'']]], + ['mat_12',['mat',['../group___mesh_i_o.html#ad16fe831da261fdf27e971c77c3e8a60',1,'manifold::ExportOptions']]], + ['matchestrinormals_13',['matchestrinormals',['../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_14',['Material',['../group___mesh_i_o.html#structmanifold_1_1_material',1,'manifold']]], + ['memory_20management_15',['Note on memory management',['..//github/workspace/bindings/wasm/README.md#autotoc_md9',1,'']]], + ['mengersponge_16',['MengerSponge',['../group___samples.html#ga31bc13b03579ca41da7ae9b5ba171fae',1,'manifold']]], + ['merge_17',['Merge',['../structmanifold_1_1_mesh_g_l.html#a2078d075bef279041b67769e4197c254',1,'manifold::MeshGL']]], + ['mergefromvert_18',['mergeFromVert',['../structmanifold_1_1_mesh_g_l.html#a77a299604952d11f9859c85f6e7b0078',1,'manifold::MeshGL']]], + ['mergetovert_19',['mergeToVert',['../structmanifold_1_1_mesh_g_l.html#aefcc49e01a1d6de7ce57830d55b66e9a',1,'manifold::MeshGL']]], + ['mesh_20',['Mesh',['../group___connections.html#structmanifold_1_1_mesh',1,'manifold']]], + ['meshgl_21',['meshgl',['../structmanifold_1_1_mesh_g_l.html#a258a2922fc12421c9a5ebde99606d0ed',1,'manifold::MeshGL::MeshGL()'],['../structmanifold_1_1_mesh_g_l.html',1,'MeshGL']]], + ['meshid_22',['meshID',['../structmanifold_1_1_tri_ref.html#a3552b302dec169446141ae02c7a2dc12',1,'manifold::TriRef']]], + ['meshio_23',['MeshIO',['../group___mesh_i_o.html',1,'']]], + ['meshrelationd_24',['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_25',['MeshSize',['../struct_mesh_size.html',1,'']]], + ['metalness_26',['metalness',['../group___mesh_i_o.html#ad877087793da649b455041e10f4ed73f',1,'manifold::Material']]], + ['mingap_27',['MinGap',['../classmanifold_1_1_manifold.html#a4a193d3f0a8c3af87961a9161cb17c68',1,'manifold::Manifold']]], + ['mirror_28',['mirror',['../classmanifold_1_1_manifold.html#a90bbf2842d0a2dc394d32f1a0a32c24a',1,'manifold::Manifold::Mirror()'],['../classmanifold_1_1_cross_section.html#adf67b7a277a85b21115f7063361da2ff',1,'manifold::CrossSection::Mirror(const glm::vec2 ax) const']]], + ['miter_29',['Miter',['../classmanifold_1_1_cross_section.html#aef400c43b34e3ecc3f7b342aa821395dae4396f81cd926bb129ccf3c147c64514',1,'manifold::CrossSection']]] +]; diff --git a/docs/html/search/all_d.js b/docs/html/search/all_d.js new file mode 100644 index 000000000..f99a342b1 --- /dev/null +++ b/docs/html/search/all_d.js @@ -0,0 +1,16 @@ +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']]], + ['note_20for_20firefox_20users_3',['Note for firefox users',['..//github/workspace/bindings/wasm/examples/README.md#autotoc_md5',1,'']]], + ['note_20on_20memory_20management_4',['Note on memory management',['..//github/workspace/bindings/wasm/README.md#autotoc_md9',1,'']]], + ['numcontour_5',['NumContour',['../classmanifold_1_1_cross_section.html#af73463c82eede09392aff17a7154a00c',1,'manifold::CrossSection']]], + ['numdegeneratetris_6',['numdegeneratetris',['../structmanifold_1_1_manifold_1_1_impl.html#afe3dd0baef775b394ee1a1ee0e353e66',1,'manifold::Manifold::Impl::NumDegenerateTris()'],['../classmanifold_1_1_manifold.html#afe3dd0baef775b394ee1a1ee0e353e66',1,'manifold::Manifold::NumDegenerateTris() const']]], + ['numedge_7',['NumEdge',['../classmanifold_1_1_manifold.html#a104cf8e5b32ca6b5789e8694835f332a',1,'manifold::Manifold']]], + ['numoverlaps_8',['NumOverlaps',['../classmanifold_1_1_manifold.html#a0dd36b29fdc9003280f6b1b96907b704',1,'manifold::Manifold']]], + ['numprop_9',['numprop',['../classmanifold_1_1_manifold.html#a4895dc2eac1d414f84cb8ecf3ff28348',1,'manifold::Manifold::NumProp()'],['../structmanifold_1_1_mesh_g_l.html#adf2ac53615be5ed3bf9ce4665e81eb75',1,'manifold::MeshGL::numProp']]], + ['numpropvert_10',['NumPropVert',['../classmanifold_1_1_manifold.html#aad2ca3e816f01c7390a774c6ffa9854d',1,'manifold::Manifold']]], + ['numtri_11',['numtri',['../structmanifold_1_1_mesh_g_l.html#a3361a5e76bdb57f495d6ed826b3294b6',1,'manifold::MeshGL::NumTri()'],['../classmanifold_1_1_manifold.html#a4a625f14e59f176052a369213cd89ed6',1,'manifold::Manifold::NumTri()']]], + ['numvert_12',['numvert',['../classmanifold_1_1_cross_section.html#a85b690c706c5e2c2c29e0ced0c2728ca',1,'manifold::CrossSection::NumVert()'],['../structmanifold_1_1_mesh_g_l.html#a21b84c701fbe74b93047405e36073658',1,'manifold::MeshGL::NumVert()'],['../classmanifold_1_1_manifold.html#a85b690c706c5e2c2c29e0ced0c2728ca',1,'manifold::Manifold::NumVert()']]] +]; diff --git a/docs/html/search/all_e.js b/docs/html/search/all_e.js new file mode 100644 index 000000000..94b9e7e07 --- /dev/null +++ b/docs/html/search/all_e.js @@ -0,0 +1,17 @@ +var searchData= +[ + ['offset_0',['Offset',['../classmanifold_1_1_cross_section.html#a9040df87b5b8b9b7705d6c6e62188d8a',1,'manifold::CrossSection']]], + ['on_20memory_20management_1',['Note on memory management',['..//github/workspace/bindings/wasm/README.md#autotoc_md9',1,'']]], + ['operator_2a_2',['operator*',['../structmanifold_1_1_box.html#a60e8048a284bf5f5de8bc93fe2e3b617',1,'manifold::Box::operator*()'],['../structmanifold_1_1_rect.html#a2ef09e7a095674473637a34b26b4b389',1,'manifold::Rect::operator*()']]], + ['operator_2a_3d_3',['operator*=',['../structmanifold_1_1_box.html#af62267ab92ad369671e2cb34a296d4fc',1,'manifold::Box::operator*=()'],['../structmanifold_1_1_rect.html#aec959d2e100436dce6e226adb93ce9aa',1,'manifold::Rect::operator*=()']]], + ['operator_2b_4',['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_5',['operator+=',['../classmanifold_1_1_cross_section.html#a1876fe37a88ce88f560d70e869e0b82a',1,'manifold::CrossSection::operator+=()'],['../classmanifold_1_1_manifold.html#a530ec6ae990090f4b5c52f0d32eb2688',1,'manifold::Manifold::operator+=()'],['../structmanifold_1_1_box.html#a994c4a973b15e5f2f7dbccb7b5dc19d4',1,'manifold::Box::operator+=()'],['../structmanifold_1_1_rect.html#a88e57e987bcbbc947831388b367fa036',1,'manifold::Rect::operator+=()']]], + ['operator_2d_6',['operator-',['../classmanifold_1_1_cross_section.html#af6a000221ca368c9f2ed3e1f271cfb7f',1,'manifold::CrossSection::operator-()'],['../classmanifold_1_1_manifold.html#ad9da8c505e6846e9645008825833e1da',1,'manifold::Manifold::operator-()']]], + ['operator_2d_3d_7',['operator-=',['../classmanifold_1_1_cross_section.html#a3f6a38bbe4bc0fbb90efa8aee5da12c0',1,'manifold::CrossSection::operator-=()'],['../classmanifold_1_1_manifold.html#ae17823c1f0efdfa41324892e52ab1f2b',1,'manifold::Manifold::operator-=()']]], + ['operator_5e_8',['operator^',['../classmanifold_1_1_cross_section.html#a34fcc007d18275e2cc32f4c99bc94cda',1,'manifold::CrossSection::operator^()'],['../classmanifold_1_1_manifold.html#ad1e4e5720f01934c44aebc597be4d104',1,'manifold::Manifold::operator^()']]], + ['operator_5e_3d_9',['operator^=',['../classmanifold_1_1_cross_section.html#aa0e45fcdedab6a1288682bbb9a9959b3',1,'manifold::CrossSection::operator^=()'],['../classmanifold_1_1_manifold.html#a88768bbf9fabf89e72b27a45321b6522',1,'manifold::Manifold::operator^=()']]], + ['options_10',['Options',['../struct_options.html',1,'']]], + ['optype_11',['OpType',['../group___core.html#gaa1aa1c6a8f3bbed5b167bc2d4511b969',1,'manifold']]], + ['org_20manifoldcad_20org_20a_12',['org manifoldcad org a',['..//github/workspace/bindings/wasm/README.md#autotoc_md6',1,'<a href="https://manifoldcad.org" >ManifoldCAD.org</a>'],['..//github/workspace/README.md#autotoc_md18',1,'<a href="https://manifoldcad.org" >ManifoldCAD.org</a>']]], + ['originalid_13',['originalid',['../classmanifold_1_1_manifold.html#a65b3ff79efc694738a4f56270cc608e6',1,'manifold::Manifold::OriginalID()'],['../structmanifold_1_1_manifold_1_1_impl.html#aa09887a4f79bfc78615dbd09d9001fd7',1,'manifold::Manifold::Impl::MeshRelationD::originalID'],['../structmanifold_1_1_tri_ref.html#aa09887a4f79bfc78615dbd09d9001fd7',1,'manifold::TriRef::originalID']]] +]; diff --git a/docs/html/search/all_f.js b/docs/html/search/all_f.js new file mode 100644 index 000000000..10528d669 --- /dev/null +++ b/docs/html/search/all_f.js @@ -0,0 +1,17 @@ +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()'],['../structmanifold_1_1_mesh_g_l.html#acd76b1c12cd41083eeef7b6f09c32141',1,'manifold::MeshGL::precision'],['../group___connections.html#acd76b1c12cd41083eeef7b6f09c32141',1,'manifold::Mesh::precision']]], + ['private_6',['Private',['../group___private.html',1,'']]], + ['processoverlaps_7',['processOverlaps',['../group___debug.html#a7166fd3caef3744f7241075f21f76af3',1,'manifold::ExecutionParams']]], + ['profiling_8',['Profiling',['..//github/workspace/README.md#autotoc_md29',1,'']]], + ['project_9',['Project',['../classmanifold_1_1_manifold.html#a839fddf7415bbad41114268f1c4d3c47',1,'manifold::Manifold']]], + ['properties_10',['Properties',['../group___connections.html#structmanifold_1_1_properties',1,'manifold']]], + ['python_11',['Python',['..//github/workspace/README.md#autotoc_md24',1,'']]], + ['python_20bindings_12',['Python Bindings',['../index.html',1,'']]], + ['python_20colab_20example_20a_13',['<a href="https://colab.research.google.com/drive/1VxrFYHPSHZgUbl9TeWzCeovlpXrPQ5J5?usp=sharing" >Python Colab Example</a>',['..//github/workspace/README.md#autotoc_md19',1,'']]] +]; 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..0255fc40c --- /dev/null +++ b/docs/html/search/classes_10.js @@ -0,0 +1,32 @@ +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_20uint64_20_3e_11',['Vec< Uint64 >',['../classmanifold_1_1_vec.html',1,'manifold']]], + ['vec_3c_20unsigned_20char_20_3e_12',['Vec< unsigned char >',['../classmanifold_1_1_vec.html',1,'manifold']]], + ['vec_3c_20v_20_3e_13',['Vec< V >',['../classmanifold_1_1_vec.html',1,'manifold']]], + ['vecview_14',['VecView',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20char_20_3e_15',['VecView< char >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20const_20manifold_3a_3atmpedge_20_3e_16',['VecView< const manifold::TmpEdge >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20float_20_3e_17',['VecView< float >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20glm_3a_3aivec3_20_3e_18',['VecView< glm::ivec3 >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20glm_3a_3avec3_20_3e_19',['VecView< glm::vec3 >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20glm_3a_3avec4_20_3e_20',['VecView< glm::vec4 >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20int_20_3e_21',['VecView< int >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20manifold_3a_3abox_20_3e_22',['VecView< manifold::Box >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20manifold_3a_3ahalfedge_20_3e_23',['VecView< manifold::Halfedge >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20manifold_3a_3atriref_20_3e_24',['VecView< manifold::TriRef >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20thrust_3a_3apair_3c_20int_2c_20int_20_3e_20_3e_25',['VecView< thrust::pair< int, int > >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20uint64_20_3e_26',['VecView< Uint64 >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20unsigned_20char_20_3e_27',['VecView< unsigned char >',['../classmanifold_1_1_vec_view.html',1,'manifold']]], + ['vecview_3c_20v_20_3e_28',['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..0a6e1de1d --- /dev/null +++ b/docs/html/search/classes_4.js @@ -0,0 +1,11 @@ +var searchData= +[ + ['geometryerr_0',['geometryErr',['../structmanifold_1_1geometry_err.html',1,'manifold']]], + ['glm_5fname_1',['glm_name',['../structglm__name.html',1,'']]], + ['glm_5fname_3c_20glm_3a_3aivec3_20_3e_2',['glm_name< glm::ivec3 >',['../structglm__name_3_01glm_1_1ivec3_01_4.html',1,'']]], + ['glm_5fname_3c_20glm_3a_3amat3x2_20_3e_3',['glm_name< glm::mat3x2 >',['../structglm__name_3_01glm_1_1mat3x2_01_4.html',1,'']]], + ['glm_5fname_3c_20glm_3a_3amat4x3_20_3e_4',['glm_name< glm::mat4x3 >',['../structglm__name_3_01glm_1_1mat4x3_01_4.html',1,'']]], + ['glm_5fname_3c_20glm_3a_3avec2_20_3e_5',['glm_name< glm::vec2 >',['../structglm__name_3_01glm_1_1vec2_01_4.html',1,'']]], + ['glm_5fname_3c_20glm_3a_3avec3_20_3e_6',['glm_name< glm::vec3 >',['../structglm__name_3_01glm_1_1vec3_01_4.html',1,'']]], + ['gyroidsdf_7',['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..c3a48ed8b --- /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_20glm_3a_3aivec3_20_3e_2',['hash< glm::ivec3 >',['../structstd_1_1hash_3_01glm_1_1ivec3_01_4.html',1,'std']]], + ['hash_3c_20std_3a_3apair_3c_20int_2c_20int_20_3e_20_3e_3',['hash< std::pair< int, int > >',['../structstd_1_1hash_3_01std_1_1pair_3_01int_00_01int_01_4_01_4.html',1,'std']]], + ['hashtable_4',['HashTable',['../classmanifold_1_1_hash_table.html',1,'manifold']]], + ['hashtabled_5',['HashTableD',['../classmanifold_1_1_hash_table_d.html',1,'manifold']]] +]; 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..c990a9ddc --- /dev/null +++ b/docs/html/search/classes_d.js @@ -0,0 +1,9 @@ +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']]], + ['svdset_5',['SVDSet',['../group___connections.html#structmanifold_1_1_s_v_d_set',1,'manifold']]] +]; diff --git a/docs/html/search/classes_e.js b/docs/html/search/classes_e.js new file mode 100644 index 000000000..fa25b46dc --- /dev/null +++ b/docs/html/search/classes_e.js @@ -0,0 +1,12 @@ +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',['../structmanifold_1_1_tri_ref.html',1,'manifold']]], + ['type_5fcaster_3c_20glm_3a_3amat_3c_20c_2c_20r_2c_20t_2c_20q_20_3e_20_3e_5',['type_caster< glm::mat< C, R, T, Q > >',['../structnb_1_1detail_1_1type__caster_3_01glm_1_1mat_3_01_c_00_01_r_00_01_t_00_01_q_01_4_01_4.html',1,'nb::detail']]], + ['type_5fcaster_3c_20glm_3a_3avec_3c_20n_2c_20t_2c_20q_20_3e_20_3e_6',['type_caster< glm::vec< N, T, Q > >',['../structnb_1_1detail_1_1type__caster_3_01glm_1_1vec_3_01_n_00_01_t_00_01_q_01_4_01_4.html',1,'nb::detail']]], + ['type_5fcaster_3c_20manifold_3a_3avecview_3c_20glm_3a_3avec_3c_20n_2c_20t_2c_20q_20_3e_20_3e_20_3e_7',['type_caster< manifold::VecView< glm::vec< N, T, Q > > >',['../structnb_1_1detail_1_1type__caster_3_01manifold_1_1_vec_view_3_01glm_1_1vec_3_01_n_00_01_t_00_01_q_01_4_01_4_01_4.html',1,'nb::detail']]], + ['type_5fcaster_3c_20std_3a_3avector_3c_20glm_3a_3avec_3c_20n_2c_20t_2c_20q_20_3e_20_3e_20_3e_8',['type_caster< std::vector< glm::vec< N, T, Q > > >',['../structnb_1_1detail_1_1type__caster_3_01std_1_1vector_3_01glm_1_1vec_3_01_n_00_01_t_00_01_q_01_4_01_4_01_4.html',1,'nb::detail']]] +]; diff --git a/docs/html/search/classes_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..337d6cc13 --- /dev/null +++ b/docs/html/search/close.svg @@ -0,0 +1,18 @@ + + + + + + diff --git a/docs/html/search/enums_0.js b/docs/html/search/enums_0.js new file mode 100644 index 000000000..febcf1f7c --- /dev/null +++ b/docs/html/search/enums_0.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['fillrule_0',['FillRule',['../classmanifold_1_1_cross_section.html#a9a534b0377c9ca41983d53b0dae0d5a4',1,'manifold::CrossSection']]] +]; diff --git a/docs/html/search/enums_1.js b/docs/html/search/enums_1.js new file mode 100644 index 000000000..7b4fe3d01 --- /dev/null +++ b/docs/html/search/enums_1.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['jointype_0',['JoinType',['../classmanifold_1_1_cross_section.html#aef400c43b34e3ecc3f7b342aa821395d',1,'manifold::CrossSection']]] +]; diff --git a/docs/html/search/enums_2.js b/docs/html/search/enums_2.js new file mode 100644 index 000000000..f0b04914f --- /dev/null +++ b/docs/html/search/enums_2.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['optype_0',['OpType',['../group___core.html#gaa1aa1c6a8f3bbed5b167bc2d4511b969',1,'manifold']]] +]; diff --git a/docs/html/search/enumvalues_0.js b/docs/html/search/enumvalues_0.js new file mode 100644 index 000000000..a69a26fb4 --- /dev/null +++ b/docs/html/search/enumvalues_0.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['evenodd_0',['EvenOdd',['../classmanifold_1_1_cross_section.html#a9a534b0377c9ca41983d53b0dae0d5a4a8e586e4bd2c45e86222301f2e6e0e390',1,'manifold::CrossSection']]] +]; diff --git a/docs/html/search/enumvalues_1.js b/docs/html/search/enumvalues_1.js new file mode 100644 index 000000000..92ec4fc30 --- /dev/null +++ b/docs/html/search/enumvalues_1.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['miter_0',['Miter',['../classmanifold_1_1_cross_section.html#aef400c43b34e3ecc3f7b342aa821395dae4396f81cd926bb129ccf3c147c64514',1,'manifold::CrossSection']]] +]; diff --git a/docs/html/search/enumvalues_2.js b/docs/html/search/enumvalues_2.js new file mode 100644 index 000000000..b654db0b2 --- /dev/null +++ b/docs/html/search/enumvalues_2.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['negative_0',['Negative',['../classmanifold_1_1_cross_section.html#a9a534b0377c9ca41983d53b0dae0d5a4affb9356ff2b7da85c75c92fa7ea03b8b',1,'manifold::CrossSection']]], + ['nonzero_1',['NonZero',['../classmanifold_1_1_cross_section.html#a9a534b0377c9ca41983d53b0dae0d5a4a3d0365a27a39c0af183445fc4d932a8a',1,'manifold::CrossSection']]] +]; diff --git a/docs/html/search/enumvalues_3.js b/docs/html/search/enumvalues_3.js new file mode 100644 index 000000000..05a616946 --- /dev/null +++ b/docs/html/search/enumvalues_3.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['positive_0',['Positive',['../classmanifold_1_1_cross_section.html#a9a534b0377c9ca41983d53b0dae0d5a4a3289297424e01eda5b788c083bbf3147',1,'manifold::CrossSection']]] +]; diff --git a/docs/html/search/enumvalues_4.js b/docs/html/search/enumvalues_4.js new file mode 100644 index 000000000..f5d70a315 --- /dev/null +++ b/docs/html/search/enumvalues_4.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['round_0',['Round',['../classmanifold_1_1_cross_section.html#aef400c43b34e3ecc3f7b342aa821395dab7f41fc1412ad2ee75e9b2635d3b9d5c',1,'manifold::CrossSection']]] +]; diff --git a/docs/html/search/enumvalues_5.js b/docs/html/search/enumvalues_5.js new file mode 100644 index 000000000..d39fd05d9 --- /dev/null +++ b/docs/html/search/enumvalues_5.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['square_0',['Square',['../classmanifold_1_1_cross_section.html#aef400c43b34e3ecc3f7b342aa821395daceb46ca115d05c51aa5a16a8867c3304',1,'manifold::CrossSection']]] +]; diff --git a/docs/html/search/functions_0.js b/docs/html/search/functions_0.js new file mode 100644 index 000000000..7296cf97e --- /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..613529410 --- /dev/null +++ b/docs/html/search/functions_1.js @@ -0,0 +1,8 @@ +var searchData= +[ + ['batchboolean_0',['batchboolean',['../classmanifold_1_1_cross_section.html#a8543728360bc7dda5472d5aa8647b36e',1,'manifold::CrossSection::BatchBoolean()'],['../classmanifold_1_1_manifold.html#a1b30c42e224bda7e71a3ed3cf02319c1',1,'manifold::Manifold::BatchBoolean()']]], + ['boolean_1',['boolean',['../classmanifold_1_1_cross_section.html#a05734d6b0b1fb38d56865b9c73c806f2',1,'manifold::CrossSection::Boolean()'],['../classmanifold_1_1_manifold.html#a9aad9d9b9a58ff2b7622de673742d1df',1,'manifold::Manifold::Boolean(const Manifold &second, OpType op) const']]], + ['boundingbox_2',['BoundingBox',['../classmanifold_1_1_manifold.html#a3d711d458596b520edd4cd7948a53e67',1,'manifold::Manifold']]], + ['bounds_3',['Bounds',['../classmanifold_1_1_cross_section.html#ae69af2b193a98c4adc6f613a7463482c',1,'manifold::CrossSection']]], + ['box_4',['box',['../structmanifold_1_1_box.html#adea1928c15ca1eb88b6619bc554911b5',1,'manifold::Box::Box()'],['../structmanifold_1_1_box.html#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..d6fb2517f --- /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..3555cb53a --- /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..9b1fa5656 --- /dev/null +++ b/docs/html/search/functions_13.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()']]], + ['warpbatch_1',['warpbatch',['../classmanifold_1_1_cross_section.html#ae004e45467f97624c89465248f4ffda1',1,'manifold::CrossSection::WarpBatch()'],['../classmanifold_1_1_manifold.html#a76546a15aa48f9a9064e7bfc7792c302',1,'manifold::Manifold::WarpBatch()']]] +]; diff --git a/docs/html/search/functions_2.js b/docs/html/search/functions_2.js new file mode 100644 index 000000000..8e355ae9f --- /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',['../classmanifold_1_1_manifold.html#a69c1ea423ea019bb932e3f55d3f6ff50',1,'manifold::Manifold::CalculateNormals()'],['../structmanifold_1_1_manifold_1_1_impl.html#adef45f00696640f682ede12311bdace7',1,'manifold::Manifold::Impl::CalculateNormals()']]], + ['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#acc962337837219c991a414bf4033ef61',1,'manifold::Manifold::Impl::CreateTangents(int normalIdx)'],['../structmanifold_1_1_manifold_1_1_impl.html#ace17948374ae1178c45e661c1b95cc8b',1,'manifold::Manifold::Impl::CreateTangents(std::vector< Smoothness >)']]], + ['crosssection_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..32cd4d402 --- /dev/null +++ b/docs/html/search/functions_3.js @@ -0,0 +1,7 @@ +var searchData= +[ + ['decompose_0',['decompose',['../classmanifold_1_1_cross_section.html#a48f77ce6390caee13a94f681893fb65c',1,'manifold::CrossSection::Decompose()'],['../classmanifold_1_1_manifold.html#a7f20b130779680156ce0d28d91e5d106',1,'manifold::Manifold::Decompose()']]], + ['distancetriangletrianglesquared_1',['DistanceTriangleTriangleSquared',['../namespacemanifold.html#af8fb0f066f81a72edd0d91c2e1957329',1,'manifold']]], + ['doesoverlap_2',['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_3',['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..4fd540bfa --- /dev/null +++ b/docs/html/search/functions_4.js @@ -0,0 +1,7 @@ +var searchData= +[ + ['edgecollisions_0',['EdgeCollisions',['../structmanifold_1_1_manifold_1_1_impl.html#afed30f82c409a32c13e68079a5b366a5',1,'manifold::Manifold::Impl']]], + ['edgeedgedist_1',['EdgeEdgeDist',['../namespacemanifold.html#ad1d9e7b62d9b78d53b339584180bd79c',1,'manifold']]], + ['exportmesh_2',['exportmesh',['../group___mesh_i_o.html#gac28a5cd14ebf185edff7a55c4efb5edb',1,'manifold::ExportMesh(const std::string &filename, const Mesh &mesh, const ExportOptions &options)'],['../group___mesh_i_o.html#ga83ff5d8f4ee07ce7902b1d9ccea3640c',1,'manifold::ExportMesh(const std::string &filename, const MeshGL &mesh, const ExportOptions &options)']]], + ['extrude_3',['Extrude',['../classmanifold_1_1_manifold.html#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..610fca681 --- /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#ae2e222860f6cfa46e1c0e270d26f5976',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..93dbbedf8 --- /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..59890f301 --- /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#ab7abcb084ad024cb903caa4e4715f713',1,'manifold::Manifold::Impl::Impl(Shape, const glm::mat4x3=glm::mat4x3(1))'],['../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..4d0ac5202 --- /dev/null +++ b/docs/html/search/functions_a.js @@ -0,0 +1,11 @@ +var searchData= +[ + ['manifold_0',['manifold',['../classmanifold_1_1_manifold.html#ad5f60691d05e3402630122740cdf3a0b',1,'manifold::Manifold::Manifold()'],['../classmanifold_1_1_manifold.html#a4bc17f3828311b81bf61c34805501599',1,'manifold::Manifold::Manifold(const MeshGL &, const std::vector< float > &propertyTolerance={})'],['../classmanifold_1_1_manifold.html#a3f761d66cf1aa619203bb7622a5f93ea',1,'manifold::Manifold::Manifold(const Mesh &)']]], + ['manifoldparams_1',['ManifoldParams',['../group___debug.html#ga4a00dd8e8dff2c4f8a9105d1a5558275',1,'manifold']]], + ['matchestrinormals_2',['matchestrinormals',['../classmanifold_1_1_manifold.html#a611a5fd95dc5d49cd88182b8ead722b7',1,'manifold::Manifold::MatchesTriNormals()'],['../structmanifold_1_1_manifold_1_1_impl.html#a611a5fd95dc5d49cd88182b8ead722b7',1,'manifold::Manifold::Impl::MatchesTriNormals()']]], + ['mengersponge_3',['MengerSponge',['../group___samples.html#ga31bc13b03579ca41da7ae9b5ba171fae',1,'manifold']]], + ['merge_4',['Merge',['../structmanifold_1_1_mesh_g_l.html#a2078d075bef279041b67769e4197c254',1,'manifold::MeshGL']]], + ['meshgl_5',['MeshGL',['../structmanifold_1_1_mesh_g_l.html#a258a2922fc12421c9a5ebde99606d0ed',1,'manifold::MeshGL']]], + ['mingap_6',['MinGap',['../classmanifold_1_1_manifold.html#a4a193d3f0a8c3af87961a9161cb17c68',1,'manifold::Manifold']]], + ['mirror_7',['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..6c66a9630 --- /dev/null +++ b/docs/html/search/functions_b.js @@ -0,0 +1,11 @@ +var searchData= +[ + ['numcontour_0',['NumContour',['../classmanifold_1_1_cross_section.html#af73463c82eede09392aff17a7154a00c',1,'manifold::CrossSection']]], + ['numdegeneratetris_1',['numdegeneratetris',['../classmanifold_1_1_manifold.html#afe3dd0baef775b394ee1a1ee0e353e66',1,'manifold::Manifold::NumDegenerateTris()'],['../structmanifold_1_1_manifold_1_1_impl.html#afe3dd0baef775b394ee1a1ee0e353e66',1,'manifold::Manifold::Impl::NumDegenerateTris()']]], + ['numedge_2',['NumEdge',['../classmanifold_1_1_manifold.html#a104cf8e5b32ca6b5789e8694835f332a',1,'manifold::Manifold']]], + ['numoverlaps_3',['NumOverlaps',['../classmanifold_1_1_manifold.html#a0dd36b29fdc9003280f6b1b96907b704',1,'manifold::Manifold']]], + ['numprop_4',['NumProp',['../classmanifold_1_1_manifold.html#a4895dc2eac1d414f84cb8ecf3ff28348',1,'manifold::Manifold']]], + ['numpropvert_5',['NumPropVert',['../classmanifold_1_1_manifold.html#aad2ca3e816f01c7390a774c6ffa9854d',1,'manifold::Manifold']]], + ['numtri_6',['numtri',['../structmanifold_1_1_mesh_g_l.html#a3361a5e76bdb57f495d6ed826b3294b6',1,'manifold::MeshGL::NumTri()'],['../classmanifold_1_1_manifold.html#a4a625f14e59f176052a369213cd89ed6',1,'manifold::Manifold::NumTri()']]], + ['numvert_7',['numvert',['../classmanifold_1_1_cross_section.html#a85b690c706c5e2c2c29e0ced0c2728ca',1,'manifold::CrossSection::NumVert()'],['../structmanifold_1_1_mesh_g_l.html#a21b84c701fbe74b93047405e36073658',1,'manifold::MeshGL::NumVert()'],['../classmanifold_1_1_manifold.html#a85b690c706c5e2c2c29e0ced0c2728ca',1,'manifold::Manifold::NumVert()']]] +]; diff --git a/docs/html/search/functions_c.js b/docs/html/search/functions_c.js new file mode 100644 index 000000000..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..bd361fe35 --- /dev/null +++ b/docs/html/search/functions_d.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['precision_0',['Precision',['../classmanifold_1_1_manifold.html#a013e5ce70b14d7d19393bcdffbc73ce2',1,'manifold::Manifold']]], + ['project_1',['Project',['../classmanifold_1_1_manifold.html#a839fddf7415bbad41114268f1c4d3c47',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..f1f480226 --- /dev/null +++ b/docs/html/search/functions_e.js @@ -0,0 +1,12 @@ +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']]], + ['refinetolength_2',['RefineToLength',['../classmanifold_1_1_manifold.html#a4fa475bc00e8b7a8fe28eea6b2d0e69e',1,'manifold::Manifold']]], + ['reindexverts_3',['ReindexVerts',['../structmanifold_1_1_manifold_1_1_impl.html#a9c45d5f57ab940c4a2682d6f11fdab40',1,'manifold::Manifold::Impl']]], + ['reserveids_4',['ReserveIDs',['../classmanifold_1_1_manifold.html#a1d7e7e674ce7bd9954dc0d54ec6ebc8c',1,'manifold::Manifold']]], + ['revolve_5',['Revolve',['../classmanifold_1_1_manifold.html#aaf8fa0b43477e935d650c2f774d76c85',1,'manifold::Manifold']]], + ['rotate_6',['rotate',['../classmanifold_1_1_cross_section.html#a95da829a99ea68c24170525e849e7dc4',1,'manifold::CrossSection::Rotate()'],['../classmanifold_1_1_manifold.html#a54569c8da01e3385a426011a40a60629',1,'manifold::Manifold::Rotate()']]], + ['rotateup_7',['RotateUp',['../group___connections.html#ga8997efa1e8a2c5fcc69314c863a8b6da',1,'manifold']]], + ['roundedframe_8',['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..b2f1c913b --- /dev/null +++ b/docs/html/search/functions_f.js @@ -0,0 +1,30 @@ +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']]], + ['setnormals_5',['SetNormals',['../structmanifold_1_1_manifold_1_1_impl.html#a47e442af7d6655edf6dfef50cb958210',1,'manifold::Manifold::Impl']]], + ['setprecision_6',['SetPrecision',['../structmanifold_1_1_manifold_1_1_impl.html#a32981853ceaf771ca541df5b5c6e085b',1,'manifold::Manifold::Impl']]], + ['setproperties_7',['SetProperties',['../classmanifold_1_1_manifold.html#a1aaf5a6d1a3d8c22f1a2c57a653cc389',1,'manifold::Manifold']]], + ['simplify_8',['Simplify',['../classmanifold_1_1_cross_section.html#aa46f202c1b92251f77fd497dc8fd9daf',1,'manifold::CrossSection']]], + ['simplifytopology_9',['SimplifyTopology',['../structmanifold_1_1_manifold_1_1_impl.html#a5814bb78c6aee8506a332d6cacf76af7',1,'manifold::Manifold::Impl']]], + ['sind_10',['sind',['../group___connections.html#gaf191247f966a40ecf3ee0fe9a717c0f3',1,'manifold']]], + ['size_11',['size',['../structmanifold_1_1_box.html#adedb961e2415f91bef56c5ca13e1e651',1,'manifold::Box::Size()'],['../structmanifold_1_1_rect.html#a232479a21f63dd4e6868cdedec53fa71',1,'manifold::Rect::Size()']]], + ['slice_12',['Slice',['../classmanifold_1_1_manifold.html#a8e75e8acf7a0cc2ef5cbe7c13a047c6a',1,'manifold::Manifold']]], + ['smooth_13',['smooth',['../classmanifold_1_1_manifold.html#aad322c5b69ab571a4f4fb5b26f945b90',1,'manifold::Manifold::Smooth(const Mesh &, const std::vector< Smoothness > &sharpenedEdges={})'],['../classmanifold_1_1_manifold.html#aff03aac40d42a60f8e4254db90530c83',1,'manifold::Manifold::Smooth(const MeshGL &, const std::vector< Smoothness > &sharpenedEdges={})']]], + ['smoothbynormals_14',['SmoothByNormals',['../classmanifold_1_1_manifold.html#aa0cbb9710c375f40591c3ae2dd62f2b4',1,'manifold::Manifold']]], + ['smoothout_15',['SmoothOut',['../classmanifold_1_1_manifold.html#a8ce7d02b7f16afb5e9bfb8a948e206d3',1,'manifold::Manifold']]], + ['sortfaces_16',['SortFaces',['../structmanifold_1_1_manifold_1_1_impl.html#a9c6ad8be3b98a1f83c7d9a7df1f983c8',1,'manifold::Manifold::Impl']]], + ['sortverts_17',['SortVerts',['../structmanifold_1_1_manifold_1_1_impl.html#a960f240018111751cf0a91339a1d1b08',1,'manifold::Manifold::Impl']]], + ['spectralnorm_18',['SpectralNorm',['../group___connections.html#ga50a9d6292886da472798354447a68cd7',1,'manifold']]], + ['sphere_19',['Sphere',['../classmanifold_1_1_manifold.html#a1fa0a21aed71099905b89a10bcde0539',1,'manifold::Manifold']]], + ['split_20',['Split',['../classmanifold_1_1_manifold.html#a60e241b8a56d334b3d2d3dbd2fc808ba',1,'manifold::Manifold']]], + ['splitbyplane_21',['SplitByPlane',['../classmanifold_1_1_manifold.html#adc134d7a6dfbf8c74e5d531bbeb330cb',1,'manifold::Manifold']]], + ['square_22',['Square',['../classmanifold_1_1_cross_section.html#a6e14a9728e2b4a5912c70c8c1b42f029',1,'manifold::CrossSection']]], + ['status_23',['Status',['../classmanifold_1_1_manifold.html#a423e2f2a67ccc0662a97e018b2c3886d',1,'manifold::Manifold']]], + ['stretchybracelet_24',['StretchyBracelet',['../group___samples.html#gaa093ef8b44f049141ccbaca556f88cd3',1,'manifold']]], + ['subdivide_25',['Subdivide',['../structmanifold_1_1_manifold_1_1_impl.html#abe4f5b3c2e601eb17c121dfd6c755445',1,'manifold::Manifold::Impl']]], + ['svd_26',['SVD',['../group___connections.html#ga52654eb696e6ea2b67dcd45063d1724a',1,'manifold']]] +]; diff --git a/docs/html/search/groups_0.js b/docs/html/search/groups_0.js new file mode 100644 index 000000000..61be2419a --- /dev/null +++ b/docs/html/search/groups_0.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['connections_0',['Connections',['../group___connections.html',1,'']]], + ['core_1',['Core',['../group___core.html',1,'']]] +]; diff --git a/docs/html/search/groups_1.js b/docs/html/search/groups_1.js new file mode 100644 index 000000000..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..ffb6cf0d0 --- /dev/null +++ b/docs/html/search/mag.svg @@ -0,0 +1,24 @@ + + + + + + + diff --git a/docs/html/search/mag_d.svg b/docs/html/search/mag_d.svg new file mode 100644 index 000000000..4122773f9 --- /dev/null +++ b/docs/html/search/mag_d.svg @@ -0,0 +1,24 @@ + + + + + + + diff --git a/docs/html/search/mag_sel.svg b/docs/html/search/mag_sel.svg new file mode 100644 index 000000000..553dba877 --- /dev/null +++ b/docs/html/search/mag_sel.svg @@ -0,0 +1,31 @@ + + + + + + + + + diff --git a/docs/html/search/mag_seld.svg b/docs/html/search/mag_seld.svg new file mode 100644 index 000000000..c906f84c8 --- /dev/null +++ b/docs/html/search/mag_seld.svg @@ -0,0 +1,31 @@ + + + + + + + + + diff --git a/docs/html/search/namespaces_0.js b/docs/html/search/namespaces_0.js new file mode 100644 index 000000000..d2dffc716 --- /dev/null +++ b/docs/html/search/namespaces_0.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['bricks_0',['bricks',['../namespacebricks.html',1,'']]] +]; diff --git a/docs/html/search/namespaces_1.js b/docs/html/search/namespaces_1.js new file mode 100644 index 000000000..972924554 --- /dev/null +++ b/docs/html/search/namespaces_1.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['cube_5fwith_5fdents_0',['cube_with_dents',['../namespacecube__with__dents.html',1,'']]] +]; diff --git a/docs/html/search/namespaces_2.js b/docs/html/search/namespaces_2.js new file mode 100644 index 000000000..34bdc6360 --- /dev/null +++ b/docs/html/search/namespaces_2.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['gyroid_5fmodule_0',['gyroid_module',['../namespacegyroid__module.html',1,'']]] +]; diff --git a/docs/html/search/namespaces_3.js b/docs/html/search/namespaces_3.js new file mode 100644 index 000000000..bf9bf6a2c --- /dev/null +++ b/docs/html/search/namespaces_3.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['manifold_0',['manifold',['../namespacemanifold.html',1,'']]] +]; diff --git a/docs/html/search/namespaces_4.js b/docs/html/search/namespaces_4.js new file mode 100644 index 000000000..d28a08b22 --- /dev/null +++ b/docs/html/search/namespaces_4.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['run_5fall_0',['run_all',['../namespacerun__all.html',1,'']]] +]; diff --git a/docs/html/search/namespaces_5.js b/docs/html/search/namespaces_5.js new file mode 100644 index 000000000..7e2738996 --- /dev/null +++ b/docs/html/search/namespaces_5.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['scallop_0',['scallop',['../namespacescallop.html',1,'']]], + ['split_5fcube_1',['split_cube',['../namespacesplit__cube.html',1,'']]] +]; diff --git a/docs/html/search/pages_0.js b/docs/html/search/pages_0.js new file mode 100644 index 000000000..bdbd6f8fb --- /dev/null +++ b/docs/html/search/pages_0.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['bindings_0',['Python Bindings',['../index.html',1,'']]] +]; diff --git a/docs/html/search/pages_1.js b/docs/html/search/pages_1.js new file mode 100644 index 000000000..86325faaa --- /dev/null +++ b/docs/html/search/pages_1.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['contribute_0',['How to Contribute',['../md__c_o_n_t_r_i_b_u_t_i_n_g.html',1,'']]] +]; diff --git a/docs/html/search/pages_2.js b/docs/html/search/pages_2.js new file mode 100644 index 000000000..c77632f7e --- /dev/null +++ b/docs/html/search/pages_2.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_3.js b/docs/html/search/pages_3.js new file mode 100644 index 000000000..c5c5bb855 --- /dev/null +++ b/docs/html/search/pages_3.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['python_20bindings_0',['Python Bindings',['../index.html',1,'']]] +]; diff --git a/docs/html/search/pages_4.js b/docs/html/search/pages_4.js new file mode 100644 index 000000000..8b7edf4aa --- /dev/null +++ b/docs/html/search/pages_4.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['release_5fchecklist_0',['RELEASE_CHECKLIST',['../md__r_e_l_e_a_s_e___c_h_e_c_k_l_i_s_t.html',1,'']]] +]; diff --git a/docs/html/search/pages_5.js b/docs/html/search/pages_5.js new file mode 100644 index 000000000..8cf0ba009 --- /dev/null +++ b/docs/html/search/pages_5.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['to_20contribute_0',['How to Contribute',['../md__c_o_n_t_r_i_b_u_t_i_n_g.html',1,'']]] +]; diff --git a/docs/html/search/search.css b/docs/html/search/search.css new file mode 100644 index 000000000..a53214fcd --- /dev/null +++ b/docs/html/search/search.css @@ -0,0 +1,286 @@ +/*---------------- Search Box */ + +#MSearchBox { + position: absolute; + right: 5px; +} +/*---------------- Search box styling */ + +.SRPage * { + font-weight: normal; + line-height: normal; +} + +dark-mode-toggle { + margin-left: 5px; + display: flex; + float: right; +} + +#MSearchBox { + display: inline-block; + white-space : nowrap; + background: var(--search-background-color); + border-radius: 0.65em; + box-shadow: var(--search-box-shadow); + z-index: 102; +} + +#MSearchBox .left { + display: inline-block; + vertical-align: middle; + height: 1.4em; +} + +#MSearchSelect { + display: inline-block; + vertical-align: middle; + width: 20px; + height: 19px; + background-image: var(--search-magnification-select-image); + margin: 0 0 0 0.3em; + padding: 0; +} + +#MSearchSelectExt { + display: inline-block; + vertical-align: middle; + width: 10px; + height: 19px; + background-image: var(--search-magnification-image); + margin: 0 0 0 0.5em; + padding: 0; +} + + +#MSearchField { + display: inline-block; + vertical-align: middle; + width: 7.5em; + height: 19px; + margin: 0 0.15em; + padding: 0; + line-height: 1em; + border:none; + color: var(--search-foreground-color); + outline: none; + font-family: var(--font-family-search); + -webkit-border-radius: 0px; + border-radius: 0px; + background: none; +} + +@media(hover: none) { + /* to avoid zooming on iOS */ + #MSearchField { + font-size: 16px; + } +} + +#MSearchBox .right { + display: inline-block; + vertical-align: middle; + width: 1.4em; + height: 1.4em; +} + +#MSearchClose { + display: none; + font-size: inherit; + background : none; + border: none; + margin: 0; + padding: 0; + outline: none; + +} + +#MSearchCloseImg { + padding: 0.3em; + margin: 0; +} + +.MSearchBoxActive #MSearchField { + color: var(--search-active-color); +} + + + +/*---------------- Search filter selection */ + +#MSearchSelectWindow { + display: none; + position: absolute; + left: 0; top: 0; + border: 1px solid var(--search-filter-border-color); + background-color: var(--search-filter-background-color); + z-index: 10001; + padding-top: 4px; + padding-bottom: 4px; + -moz-border-radius: 4px; + -webkit-border-top-left-radius: 4px; + -webkit-border-top-right-radius: 4px; + -webkit-border-bottom-left-radius: 4px; + -webkit-border-bottom-right-radius: 4px; + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); +} + +.SelectItem { + font: 8pt var(--font-family-search); + padding-left: 2px; + padding-right: 12px; + border: 0px; +} + +span.SelectionMark { + margin-right: 4px; + font-family: var(--font-family-monospace); + outline-style: none; + text-decoration: none; +} + +a.SelectItem { + display: block; + outline-style: none; + color: var(--search-filter-foreground-color); + text-decoration: none; + padding-left: 6px; + padding-right: 12px; +} + +a.SelectItem:focus, +a.SelectItem:active { + color: var(--search-filter-foreground-color); + outline-style: none; + text-decoration: none; +} + +a.SelectItem:hover { + color: var(--search-filter-highlight-text-color); + background-color: var(--search-filter-highlight-bg-color); + outline-style: none; + text-decoration: none; + cursor: pointer; + display: block; +} + +/*---------------- Search results window */ + +iframe#MSearchResults { + /*width: 60ex;*/ + height: 15em; +} + +#MSearchResultsWindow { + display: none; + position: absolute; + left: 0; top: 0; + border: 1px solid var(--search-results-border-color); + background-color: var(--search-results-background-color); + z-index:10000; + width: 300px; + height: 400px; + overflow: auto; +} + +/* ----------------------------------- */ + + +#SRIndex { + clear:both; +} + +.SREntry { + font-size: 10pt; + padding-left: 1ex; +} + +.SRPage .SREntry { + font-size: 8pt; + padding: 1px 5px; +} + +div.SRPage { + margin: 5px 2px; + background-color: var(--search-results-background-color); +} + +.SRChildren { + padding-left: 3ex; padding-bottom: .5em +} + +.SRPage .SRChildren { + display: none; +} + +.SRSymbol { + font-weight: bold; + color: var(--search-results-foreground-color); + font-family: var(--font-family-search); + text-decoration: none; + outline: none; +} + +a.SRScope { + display: block; + color: var(--search-results-foreground-color); + font-family: var(--font-family-search); + font-size: 8pt; + text-decoration: none; + outline: none; +} + +a.SRSymbol:focus, a.SRSymbol:active, +a.SRScope:focus, a.SRScope:active { + text-decoration: underline; +} + +span.SRScope { + padding-left: 4px; + font-family: var(--font-family-search); +} + +.SRPage .SRStatus { + padding: 2px 5px; + font-size: 8pt; + font-style: italic; + font-family: var(--font-family-search); +} + +.SRResult { + display: none; +} + +div.searchresults { + margin-left: 10px; + margin-right: 10px; +} + +/*---------------- External search page results */ + +.pages b { + color: white; + padding: 5px 5px 3px 5px; + background-image: var(--nav-gradient-active-image-parent); + background-repeat: repeat-x; + text-shadow: 0 1px 1px #000000; +} + +.pages { + line-height: 17px; + margin-left: 4px; + text-decoration: none; +} + +.hl { + font-weight: bold; +} + +#searchresults { + margin-bottom: 20px; +} + +.searchpages { + margin-top: 10px; +} + diff --git a/docs/html/search/search.js b/docs/html/search/search.js new file mode 100644 index 000000000..6fd40c677 --- /dev/null +++ b/docs/html/search/search.js @@ -0,0 +1,840 @@ +/* + @licstart The following is the entire license notice for the JavaScript code in this file. + + The MIT License (MIT) + + Copyright (C) 1997-2020 by Dimitri van Heesch + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software + and associated documentation files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, publish, distribute, + sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or + substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + @licend The above is the entire license notice for the JavaScript code in this file + */ +function convertToId(search) +{ + var result = ''; + for (i=0;i do a search + { + this.Search(); + } + } + + this.OnSearchSelectKey = function(evt) + { + var e = (evt) ? evt : window.event; // for IE + if (e.keyCode==40 && this.searchIndex0) // Up + { + this.searchIndex--; + this.OnSelectItem(this.searchIndex); + } + else if (e.keyCode==13 || e.keyCode==27) + { + e.stopPropagation(); + this.OnSelectItem(this.searchIndex); + this.CloseSelectionWindow(); + this.DOMSearchField().focus(); + } + return false; + } + + // --------- Actions + + // Closes the results window. + this.CloseResultsWindow = function() + { + this.DOMPopupSearchResultsWindow().style.display = 'none'; + this.DOMSearchClose().style.display = 'none'; + this.Activate(false); + } + + this.CloseSelectionWindow = function() + { + this.DOMSearchSelectWindow().style.display = 'none'; + } + + // Performs a search. + this.Search = function() + { + this.keyTimeout = 0; + + // strip leading whitespace + var searchValue = this.DOMSearchField().value.replace(/^ +/, ""); + + var code = searchValue.toLowerCase().charCodeAt(0); + var idxChar = searchValue.substr(0, 1).toLowerCase(); + if ( 0xD800 <= code && code <= 0xDBFF && searchValue > 1) // surrogate pair + { + idxChar = searchValue.substr(0, 2); + } + + var jsFile; + + var idx = indexSectionsWithContent[this.searchIndex].indexOf(idxChar); + if (idx!=-1) + { + var hexCode=idx.toString(16); + jsFile = this.resultsPath + indexSectionNames[this.searchIndex] + '_' + hexCode + '.js'; + } + + var loadJS = function(url, impl, loc){ + var scriptTag = document.createElement('script'); + scriptTag.src = url; + scriptTag.onload = impl; + scriptTag.onreadystatechange = impl; + loc.appendChild(scriptTag); + } + + var domPopupSearchResultsWindow = this.DOMPopupSearchResultsWindow(); + var domSearchBox = this.DOMSearchBox(); + var domPopupSearchResults = this.DOMPopupSearchResults(); + var domSearchClose = this.DOMSearchClose(); + var resultsPath = this.resultsPath; + + var handleResults = function() { + document.getElementById("Loading").style.display="none"; + if (typeof searchData !== 'undefined') { + createResults(resultsPath); + document.getElementById("NoMatches").style.display="none"; + } + + if (idx!=-1) { + searchResults.Search(searchValue); + } else { // no file with search results => force empty search results + searchResults.Search('===='); + } + + if (domPopupSearchResultsWindow.style.display!='block') + { + domSearchClose.style.display = 'inline-block'; + var left = getXPos(domSearchBox) + 150; + var top = getYPos(domSearchBox) + 20; + domPopupSearchResultsWindow.style.display = 'block'; + left -= domPopupSearchResults.offsetWidth; + var maxWidth = document.body.clientWidth; + var maxHeight = document.body.clientHeight; + var width = 300; + if (left<10) left=10; + if (width+left+8>maxWidth) width=maxWidth-left-8; + var height = 400; + if (height+top+8>maxHeight) height=maxHeight-top-8; + domPopupSearchResultsWindow.style.top = top + 'px'; + domPopupSearchResultsWindow.style.left = left + 'px'; + domPopupSearchResultsWindow.style.width = width + 'px'; + domPopupSearchResultsWindow.style.height = height + 'px'; + } + } + + if (jsFile) { + loadJS(jsFile, handleResults, this.DOMPopupSearchResultsWindow()); + } else { + handleResults(); + } + + this.lastSearchValue = searchValue; + } + + // -------- Activation Functions + + // Activates or deactivates the search panel, resetting things to + // their default values if necessary. + this.Activate = function(isActive) + { + if (isActive || // open it + this.DOMPopupSearchResultsWindow().style.display == 'block' + ) + { + this.DOMSearchBox().className = 'MSearchBoxActive'; + this.searchActive = true; + } + else if (!isActive) // directly remove the panel + { + this.DOMSearchBox().className = 'MSearchBoxInactive'; + this.searchActive = false; + this.lastSearchValue = '' + this.lastResultsPage = ''; + this.DOMSearchField().value = ''; + } + } +} + +// ----------------------------------------------------------------------- + +// The class that handles everything on the search results page. +function SearchResults(name) +{ + // The number of matches from the last run of . + this.lastMatchCount = 0; + this.lastKey = 0; + this.repeatOn = false; + + // Toggles the visibility of the passed element ID. + this.FindChildElement = function(id) + { + var parentElement = document.getElementById(id); + var element = parentElement.firstChild; + + while (element && element!=parentElement) + { + if (element.nodeName.toLowerCase() == 'div' && element.className == 'SRChildren') + { + return element; + } + + if (element.nodeName.toLowerCase() == 'div' && element.hasChildNodes()) + { + element = element.firstChild; + } + else if (element.nextSibling) + { + element = element.nextSibling; + } + else + { + do + { + element = element.parentNode; + } + while (element && element!=parentElement && !element.nextSibling); + + if (element && element!=parentElement) + { + element = element.nextSibling; + } + } + } + } + + this.Toggle = function(id) + { + var element = this.FindChildElement(id); + if (element) + { + if (element.style.display == 'block') + { + element.style.display = 'none'; + } + else + { + element.style.display = 'block'; + } + } + } + + // Searches for the passed string. If there is no parameter, + // it takes it from the URL query. + // + // Always returns true, since other documents may try to call it + // and that may or may not be possible. + this.Search = function(search) + { + if (!search) // get search word from URL + { + search = window.location.search; + search = search.substring(1); // Remove the leading '?' + search = unescape(search); + } + + search = search.replace(/^ +/, ""); // strip leading spaces + search = search.replace(/ +$/, ""); // strip trailing spaces + search = search.toLowerCase(); + search = convertToId(search); + + var resultRows = document.getElementsByTagName("div"); + var matches = 0; + + var i = 0; + while (i < resultRows.length) + { + var row = resultRows.item(i); + if (row.className == "SRResult") + { + var rowMatchName = row.id.toLowerCase(); + rowMatchName = rowMatchName.replace(/^sr\d*_/, ''); // strip 'sr123_' + + if (search.length<=rowMatchName.length && + rowMatchName.substr(0, search.length)==search) + { + row.style.display = 'block'; + matches++; + } + else + { + row.style.display = 'none'; + } + } + i++; + } + document.getElementById("Searching").style.display='none'; + if (matches == 0) // no results + { + document.getElementById("NoMatches").style.display='block'; + } + else // at least one result + { + document.getElementById("NoMatches").style.display='none'; + } + this.lastMatchCount = matches; + return true; + } + + // return the first item with index index or higher that is visible + this.NavNext = function(index) + { + var focusItem; + while (1) + { + var focusName = 'Item'+index; + focusItem = document.getElementById(focusName); + if (focusItem && focusItem.parentNode.parentNode.style.display=='block') + { + break; + } + else if (!focusItem) // last element + { + break; + } + focusItem=null; + index++; + } + return focusItem; + } + + this.NavPrev = function(index) + { + var focusItem; + while (1) + { + var focusName = 'Item'+index; + focusItem = document.getElementById(focusName); + if (focusItem && focusItem.parentNode.parentNode.style.display=='block') + { + break; + } + else if (!focusItem) // last element + { + break; + } + focusItem=null; + index--; + } + return focusItem; + } + + this.ProcessKeys = function(e) + { + if (e.type == "keydown") + { + this.repeatOn = false; + this.lastKey = e.keyCode; + } + else if (e.type == "keypress") + { + if (!this.repeatOn) + { + if (this.lastKey) this.repeatOn = true; + return false; // ignore first keypress after keydown + } + } + else if (e.type == "keyup") + { + this.lastKey = 0; + this.repeatOn = false; + } + return this.lastKey!=0; + } + + this.Nav = function(evt,itemIndex) + { + var e = (evt) ? evt : window.event; // for IE + if (e.keyCode==13) return true; + if (!this.ProcessKeys(e)) return false; + + if (this.lastKey==38) // Up + { + var newIndex = itemIndex-1; + var focusItem = this.NavPrev(newIndex); + if (focusItem) + { + var child = this.FindChildElement(focusItem.parentNode.parentNode.id); + if (child && child.style.display == 'block') // children visible + { + var n=0; + var tmpElem; + while (1) // search for last child + { + tmpElem = document.getElementById('Item'+newIndex+'_c'+n); + if (tmpElem) + { + focusItem = tmpElem; + } + else // found it! + { + break; + } + n++; + } + } + } + if (focusItem) + { + focusItem.focus(); + } + else // return focus to search field + { + document.getElementById("MSearchField").focus(); + } + } + else if (this.lastKey==40) // Down + { + var newIndex = itemIndex+1; + var focusItem; + var item = document.getElementById('Item'+itemIndex); + var elem = this.FindChildElement(item.parentNode.parentNode.id); + if (elem && elem.style.display == 'block') // children visible + { + focusItem = document.getElementById('Item'+itemIndex+'_c0'); + } + if (!focusItem) focusItem = this.NavNext(newIndex); + if (focusItem) focusItem.focus(); + } + else if (this.lastKey==39) // Right + { + var item = document.getElementById('Item'+itemIndex); + var elem = this.FindChildElement(item.parentNode.parentNode.id); + if (elem) elem.style.display = 'block'; + } + else if (this.lastKey==37) // Left + { + var item = document.getElementById('Item'+itemIndex); + var elem = this.FindChildElement(item.parentNode.parentNode.id); + if (elem) elem.style.display = 'none'; + } + else if (this.lastKey==27) // Escape + { + e.stopPropagation(); + searchBox.CloseResultsWindow(); + document.getElementById("MSearchField").focus(); + } + else if (this.lastKey==13) // Enter + { + return true; + } + return false; + } + + this.NavChild = function(evt,itemIndex,childIndex) + { + var e = (evt) ? evt : window.event; // for IE + if (e.keyCode==13) return true; + if (!this.ProcessKeys(e)) return false; + + if (this.lastKey==38) // Up + { + if (childIndex>0) + { + var newIndex = childIndex-1; + document.getElementById('Item'+itemIndex+'_c'+newIndex).focus(); + } + else // already at first child, jump to parent + { + document.getElementById('Item'+itemIndex).focus(); + } + } + else if (this.lastKey==40) // Down + { + var newIndex = childIndex+1; + var elem = document.getElementById('Item'+itemIndex+'_c'+newIndex); + if (!elem) // last child, jump to parent next parent + { + elem = this.NavNext(itemIndex+1); + } + if (elem) + { + elem.focus(); + } + } + else if (this.lastKey==27) // Escape + { + e.stopPropagation(); + searchBox.CloseResultsWindow(); + document.getElementById("MSearchField").focus(); + } + else if (this.lastKey==13) // Enter + { + return true; + } + return false; + } +} + +function setKeyActions(elem,action) +{ + elem.setAttribute('onkeydown',action); + elem.setAttribute('onkeypress',action); + elem.setAttribute('onkeyup',action); +} + +function setClassAttr(elem,attr) +{ + elem.setAttribute('class',attr); + elem.setAttribute('className',attr); +} + +function createResults(resultsPath) +{ + var results = document.getElementById("SRResults"); + results.innerHTML = ''; + for (var e=0; e + + + + + + +Manifold: shared.h Source File + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
shared.h
+
+
+
1// Copyright 2021 The Manifold Authors.
+
2//
+
3// Licensed under the Apache License, Version 2.0 (the "License");
+
4// you may not use this file except in compliance with the License.
+
5// You may obtain a copy of the License at
+
6//
+
7// http://www.apache.org/licenses/LICENSE-2.0
+
8//
+
9// Unless required by applicable law or agreed to in writing, software
+
10// distributed under the License is distributed on an "AS IS" BASIS,
+
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+
12// See the License for the specific language governing permissions and
+
13// limitations under the License.
+
14
+
15#pragma once
+
16
+
17#include "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 bool SameFace(const TriRef& other) const {
+
162 return meshID == other.meshID && tri == other.tri;
+
163 }
+
164};
+
+
165
+
+
170struct TmpEdge {
+
171 int first, second, halfedgeIdx;
+
172
+
173 TmpEdge() {}
+
174 TmpEdge(int start, int end, int idx) {
+
175 first = glm::min(start, end);
+
176 second = glm::max(start, end);
+
177 halfedgeIdx = idx;
+
178 }
+
179
+
180 bool operator<(const TmpEdge& other) const {
+
181 return first == other.first ? second < other.second : first < other.first;
+
182 }
+
183};
+
+
+ +
187 void operator()(thrust::tuple<TmpEdge&, const Halfedge&, int> inout) {
+
188 const Halfedge& halfedge = thrust::get<1>(inout);
+
189 int idx = thrust::get<2>(inout);
+
190 if (!halfedge.IsForward()) idx = -1;
+
191
+
192 thrust::get<0>(inout) = TmpEdge(halfedge.startVert, halfedge.endVert, idx);
+
193 }
+
194};
+
+
195
+
+ +
197 bool operator()(const TmpEdge& edge) { return edge.halfedgeIdx < 0; }
+
198};
+
+
199
+
200Vec<TmpEdge> inline CreateTmpEdges(const Vec<Halfedge>& halfedge) {
+
201 Vec<TmpEdge> edges(halfedge.size());
+
202 for_each_n(autoPolicy(edges.size()),
+
203 zip(edges.begin(), halfedge.begin(), countAt(0)), edges.size(),
+
204 Halfedge2Tmp());
+
205 int numEdge =
+
206 remove_if<decltype(edges.begin())>(
+
207 autoPolicy(edges.size()), edges.begin(), edges.end(), TmpInvalid()) -
+
208 edges.begin();
+
209 ASSERT(numEdge == halfedge.size() / 2, topologyErr, "Not oriented!");
+
210 edges.resize(numEdge);
+
211 return edges;
+
212}
+
213
+
214template <const bool inverted>
+
+ + +
217 SparseIndices& indices;
+
218
+
219 void operator()(size_t i) {
+
220 int& edge = indices.Get(i, inverted);
+
221 edge = edges[edge].halfedgeIdx;
+
222 }
+
223};
+
+
224
+
225#ifdef MANIFOLD_DEBUG
+
226inline std::ostream& operator<<(std::ostream& stream, const Halfedge& edge) {
+
227 return stream << "startVert = " << edge.startVert
+
228 << ", endVert = " << edge.endVert
+
229 << ", pairedHalfedge = " << edge.pairedHalfedge
+
230 << ", face = " << edge.face;
+
231}
+
232
+
233inline std::ostream& operator<<(std::ostream& stream, const Barycentric& bary) {
+
234 return stream << "tri = " << bary.tri << ", uvw = " << bary.uvw;
+
235}
+
236
+
237inline std::ostream& operator<<(std::ostream& stream, const TriRef& ref) {
+
238 return stream << "meshID: " << ref.meshID
+
239 << ", originalID: " << ref.originalID << ", tri: " << ref.tri;
+
240}
+
241#endif
+
242} // namespace manifold
+
Definition sparse.h:27
+
Definition vec_view.h:27
+
glm::mat3x2 GetAxisAlignedProjection(glm::vec3 normal)
Definition shared.h:61
+
Definition shared.h:144
+
Definition meshIO.h:20
+
Definition shared.h:186
+
Definition shared.h:133
+
Definition shared.h:215
+
Definition shared.h:170
+
Definition shared.h:196
+
Definition shared.h:149
+
int tri
Definition shared.h:159
+
int meshID
Definition shared.h:153
+
int originalID
Definition shared.h:156
+
Definition public.h:590
+
+
+ + + + diff --git a/docs/html/sparse_8h_source.html b/docs/html/sparse_8h_source.html new file mode 100644 index 000000000..bedb3b19d --- /dev/null +++ b/docs/html/sparse_8h_source.html @@ -0,0 +1,321 @@ + + + + + + + +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_ = Vec<char>(size * sizeof(int64_t)); }
+
52
+
53 size_t size() const { return data_.size() / sizeof(int64_t); }
+
54
+
55 Vec<int> Copy(bool use_q) const {
+
56 Vec<int> out(size());
+
57 size_t offset = pOffset;
+
58 if (use_q) offset = 1 - offset;
+
59 const int* p = ptr();
+
60 for_each(autoPolicy(out.size()), countAt(0_z), countAt(out.size()),
+
61 [&](size_t 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(size_t size) { data_.resize(size * sizeof(int64_t), -1); }
+
71
+
72 inline int& Get(size_t 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(size_t 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(size_t i) const {
+
87 VecView<const int64_t> view = AsVec64();
+
88 return view[i];
+
89 }
+
90
+
91 inline void Set(size_t i, int p, int q) {
+
92 VecView<int64_t> view = AsVec64();
+
93 view[i] = EncodePQ(p, q);
+
94 }
+
95
+
96 inline void SetPQ(size_t 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 size_t 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,
+ +
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 (size_t 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_view.h:27
+
Definition meshIO.h:20
+ +
Definition public.h:587
+
+
+ + + + 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..633abed80 --- /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..6e706f68e --- /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..98dbbf3c7 --- /dev/null +++ b/docs/html/struct_edge-members.html @@ -0,0 +1,120 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Edge Member List
+
+
+ +

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

+ + + + + + + +
east (defined in Edge)Edge
Edge(const Polygons &polys, size_t i, size_t j) (defined in Edge)Edgeinline
i (defined in Edge)Edge
j (defined in Edge)Edge
operator<(const Edge &other) const (defined in Edge)Edgeinline
west (defined in Edge)Edge
+
+ + + + diff --git a/docs/html/struct_edge.html b/docs/html/struct_edge.html new file mode 100644 index 000000000..34232b403 --- /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..d921075c7 --- /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..27f1381c1 --- /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..f9f104fd6 --- /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..741c0736a --- /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..3166e4e5e --- /dev/null +++ b/docs/html/struct_manifold_i_vec3-members.html @@ -0,0 +1,117 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
ManifoldIVec3 Member List
+
+
+ +

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

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

+Public Attributes

+int x
 
+int y
 
+int z
 
+

Member Data Documentation

+ +

◆ x

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

◆ y

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

◆ z

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

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

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

+Public Attributes

+ManifoldManifold * first
 
+ManifoldManifold * second
 
+

Member Data Documentation

+ +

◆ first

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

◆ second

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

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

+ + + +
surface_area (defined in ManifoldProperties)ManifoldProperties
volume (defined in ManifoldProperties)ManifoldProperties
+
+ + + + diff --git a/docs/html/struct_manifold_properties.html b/docs/html/struct_manifold_properties.html new file mode 100644 index 000000000..0a2c2da17 --- /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..a1962183e --- /dev/null +++ b/docs/html/struct_manifold_vec2-members.html @@ -0,0 +1,116 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
ManifoldVec2 Member List
+
+
+ +

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

+ + + +
x (defined in ManifoldVec2)ManifoldVec2
y (defined in ManifoldVec2)ManifoldVec2
+
+ + + + diff --git a/docs/html/struct_manifold_vec2.html b/docs/html/struct_manifold_vec2.html new file mode 100644 index 000000000..7a0966220 --- /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..bc7c1d818 --- /dev/null +++ b/docs/html/struct_manifold_vec3-members.html @@ -0,0 +1,117 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
ManifoldVec3 Member List
+
+
+ +

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

+ + + + +
x (defined in ManifoldVec3)ManifoldVec3
y (defined in ManifoldVec3)ManifoldVec3
z (defined in ManifoldVec3)ManifoldVec3
+
+ + + + diff --git a/docs/html/struct_manifold_vec3.html b/docs/html/struct_manifold_vec3.html new file mode 100644 index 000000000..c487dab20 --- /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..a4cf0cd9f --- /dev/null +++ b/docs/html/struct_manifold_vec4-members.html @@ -0,0 +1,118 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
ManifoldVec4 Member List
+
+
+ +

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

+ + + + + +
w (defined in ManifoldVec4)ManifoldVec4
x (defined in ManifoldVec4)ManifoldVec4
y (defined in ManifoldVec4)ManifoldVec4
z (defined in ManifoldVec4)ManifoldVec4
+
+ + + + diff --git a/docs/html/struct_manifold_vec4.html b/docs/html/struct_manifold_vec4.html new file mode 100644 index 000000000..d2476f2a2 --- /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..d51339b5b --- /dev/null +++ b/docs/html/struct_mesh_size-members.html @@ -0,0 +1,118 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
MeshSize Member List
+
+
+ +

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

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

+Public Attributes

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

Member Data Documentation

+ +

◆ numVert

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

◆ numTri

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

◆ numProp

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

◆ numPropVert

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

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

+ + + +
exportModels (defined in Options)Options
params (defined in Options)Options
+
+ + + + diff --git a/docs/html/struct_options.html b/docs/html/struct_options.html new file mode 100644 index 000000000..9b28b8be0 --- /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/structglm__name.html b/docs/html/structglm__name.html new file mode 100644 index 000000000..0ccd8661a --- /dev/null +++ b/docs/html/structglm__name.html @@ -0,0 +1,112 @@ + + + + + + + +Manifold: glm_name< T > Struct Template Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
glm_name< T > Struct Template Reference
+
+
+
+
+ + + + diff --git a/docs/html/structglm__name_3_01glm_1_1ivec3_01_4-members.html b/docs/html/structglm__name_3_01glm_1_1ivec3_01_4-members.html new file mode 100644 index 000000000..42d77e2b0 --- /dev/null +++ b/docs/html/structglm__name_3_01glm_1_1ivec3_01_4-members.html @@ -0,0 +1,116 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
glm_name< glm::ivec3 > Member List
+
+
+ +

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

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

+Static Public Attributes

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

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

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

+Static Public Attributes

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

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

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

+Static Public Attributes

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

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

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

+Static Public Attributes

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

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

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

+Static Public Attributes

+static constexpr char const name [] = "Floatx3"
 
+static constexpr char const multi_name [] = "FloatNx3"
 
+
+
+ + + + 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..641297fb6 --- /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..0c3d911cb --- /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..fb36d451e --- /dev/null +++ b/docs/html/structmanifold_1_1_halfedge-members.html @@ -0,0 +1,120 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Halfedge Member List
+
+
+ +

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

+ + + + + + + +
endVert (defined in Halfedge)Halfedge
face (defined in Halfedge)Halfedge
IsForward() const (defined in Halfedge)Halfedgeinline
operator<(const Halfedge &other) const (defined in Halfedge)Halfedgeinline
pairedHalfedge (defined in Halfedge)Halfedge
startVert (defined in Halfedge)Halfedge
+
+ + + + diff --git a/docs/html/structmanifold_1_1_halfedge.html b/docs/html/structmanifold_1_1_halfedge.html new file mode 100644 index 000000000..a7fe6b598 --- /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..6e2311183 --- /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..94b8d0d71 --- /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..32f29ec77 --- /dev/null +++ b/docs/html/structmanifold_1_1_manifold_1_1_impl-members.html @@ -0,0 +1,195 @@ + + + + + + + +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(int normalIdx)Manifold::Impl
CreateTangents(std::vector< Smoothness >)Manifold::Impl
DedupeEdge(int edge) (defined in Manifold::Impl)Manifold::Impl
EdgeCollisions(const Impl &B, bool inverted=false) constManifold::Impl
Face2Polygons(VecView< Halfedge >::IterC start, VecView< Halfedge >::IterC end, glm::mat3x2 projection) constManifold::Impl
Face2Tri(const Vec< int > &faceEdge, const Vec< TriRef > &halfedgeRef)Manifold::Impl
faceNormal_ (defined in Manifold::Impl)Manifold::Impl
Finish()Manifold::Impl
FlatFaces() const (defined in Manifold::Impl)Manifold::Impl
FormLoop(int current, int end) (defined in Manifold::Impl)Manifold::Impl
ForVert(int halfedge, std::function< void(int halfedge)> func) (defined in Manifold::Impl)Manifold::Implinline
ForVert(int halfedge, std::function< T(int halfedge)> transform, std::function< void(int halfedge, const T &here, const T &next)> binaryOp) (defined in Manifold::Impl)Manifold::Implinline
GatherFaces(const Vec< int > &faceNew2Old)Manifold::Impl
GatherFaces(const Impl &old, const Vec< int > &faceNew2Old) (defined in Manifold::Impl)Manifold::Impl
GetFaceBoxMorton(Vec< Box > &faceBox, Vec< uint32_t > &faceMorton) constManifold::Impl
GetNormal(int halfedge, int normalIdx) const (defined in Manifold::Impl)Manifold::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, const glm::mat4x3=glm::mat4x3(1))Manifold::Impl
Impl(const MeshGL &, std::vector< float > propertyTolerance={}) (defined in Manifold::Impl)Manifold::Impl
Impl(const Mesh &, const MeshRelationD &relation, const std::vector< 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
MinGap(const Impl &other, float searchLength) const (defined in Manifold::Impl)Manifold::Impl
NumDegenerateTris() constManifold::Impl
NumEdge() const (defined in Manifold::Impl)Manifold::Implinline
NumProp() const (defined in Manifold::Impl)Manifold::Implinline
NumPropVert() const (defined in Manifold::Impl)Manifold::Implinline
NumTri() const (defined in Manifold::Impl)Manifold::Implinline
NumVert() const (defined in Manifold::Impl)Manifold::Implinline
PairUp(int edge0, int edge1) (defined in Manifold::Impl)Manifold::Impl
precision_ (defined in Manifold::Impl)Manifold::Impl
Project() const (defined in Manifold::Impl)Manifold::Impl
RecursiveEdgeSwap(int edge, int &tag, std::vector< int > &visited, std::vector< int > &edgeSwapStack, std::vector< int > &edges) (defined in Manifold::Impl)Manifold::Impl
Refine(std::function< int(glm::vec3)>) (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
SetNormals(int normalIdx, float minSharpAngle)Manifold::Impl
SetPrecision(float minPrecision=-1)Manifold::Impl
Shape enum name (defined in Manifold::Impl)Manifold::Impl
SharpenEdges(float minSharpAngle, float minSmoothness) const (defined in Manifold::Impl)Manifold::Impl
SimplifyTopology()Manifold::Impl
Slice(float height) const (defined in Manifold::Impl)Manifold::Impl
SortFaces(Vec< Box > &faceBox, Vec< uint32_t > &faceMorton)Manifold::Impl
SortVerts()Manifold::Impl
SplitPinchedVerts() (defined in Manifold::Impl)Manifold::Impl
status_ (defined in Manifold::Impl)Manifold::Impl
Subdivide(std::function< int(glm::vec3)>)Manifold::Impl
Transform(const glm::mat4x3 &transform) const (defined in Manifold::Impl)Manifold::Impl
Update()Manifold::Impl
UpdateSharpenedEdges(const std::vector< Smoothness > &) const (defined in Manifold::Impl)Manifold::Impl
UpdateVert(int vert, int startEdge, int endEdge) (defined in Manifold::Impl)Manifold::Impl
VertexCollisionsZ(VecView< const glm::vec3 > vertsIn, bool inverted=false) constManifold::Impl
VertFlatFace(const Vec< bool > &) const (defined in Manifold::Impl)Manifold::Impl
vertNormal_ (defined in Manifold::Impl)Manifold::Impl
vertPos_ (defined in Manifold::Impl)Manifold::Impl
Warp(std::function< void(glm::vec3 &)> warpFunc) (defined in Manifold::Impl)Manifold::Impl
WarpBatch(std::function< void(VecView< 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..35997aea2 --- /dev/null +++ b/docs/html/structmanifold_1_1_manifold_1_1_impl.html @@ -0,0 +1,1126 @@ + + + + + + + +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, const glm::mat4x3=glm::mat4x3(1))
 
Impl (const MeshGL &, std::vector< float > propertyTolerance={})
 
 Impl (const Mesh &, const MeshRelationD &relation, const std::vector< float > &propertyTolerance={}, bool hasFaceIDs=false)
 
+void ForVert (int halfedge, std::function< void(int halfedge)> func)
 
+template<typename T >
void ForVert (int halfedge, std::function< T(int halfedge)> transform, std::function< void(int halfedge, const T &here, const T &next)> binaryOp)
 
+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)
 
+void WarpBatch (std::function< void(VecView< 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
 
+float MinGap (const Impl &other, float searchLength) 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 (VecView< Halfedge >::IterC start, VecView< Halfedge >::IterC end, glm::mat3x2 projection) const
 
+CrossSection Slice (float height) const
 
+CrossSection Project () 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 ()
 
+glm::vec3 GetNormal (int halfedge, int normalIdx) const
 
+std::vector< SmoothnessUpdateSharpenedEdges (const std::vector< Smoothness > &) const
 
+Vec< boolFlatFaces () const
 
+Vec< intVertFlatFace (const Vec< bool > &) const
 
+std::vector< SmoothnessSharpenEdges (float minSharpAngle, float minSmoothness) const
 
void SetNormals (int normalIdx, float minSharpAngle)
 
void CreateTangents (int normalIdx)
 
void CreateTangents (std::vector< Smoothness >)
 
Vec< BarycentricSubdivide (std::function< int(glm::vec3)>)
 
+void Refine (std::function< int(glm::vec3)>)
 
+ + + +

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

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,
const glm::mat4x3 m = glm::mat4x3(1) 
)
+
+

Create either a unit tetrahedron, cube or octahedron. The cube is in the first octant, while the others are symmetric about the origin.

+ +
+
+ +

◆ Impl() [2/2]

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Impl (const Meshmesh,
const MeshRelationDrelation,
const std::vector< 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 (VecView< Halfedge >::IterC start,
VecView< Halfedge >::IterC end,
glm::mat3x2 projection 
) const
+
+

Returns a set of 2D polygons formed by the input projection of the vertices of the list of Halfedges, which must be an even-manifold, meaning each vert must be referenced the same number of times as a startVert and endVert.

+ +
+
+ +

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

+ +
+
+ +

◆ SetNormals()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void SetNormals (int normalIdx,
float minSharpAngle 
)
+
+

Instead of calculating the internal shared normals like CalculateNormals does, this method fills in vertex properties, unshared across edges that are bent more than minSharpAngle.

+ +
+
+ +

◆ CreateTangents() [1/2]

+ +
+
+ + + + + + + + +
void CreateTangents (int normalIdx)
+
+

Calculates halfedgeTangent_, allowing the manifold to be refined and smoothed. The tangents form weighted cubic Beziers along each edge. This function creates circular arcs where possible (minimizing maximum curvature), constrained to the indicated property normals. Across edges that form discontinuities in the normals, the tangent vectors are zero-length, allowing the shape to form a sharp corner with minimal oscillation.

+ +
+
+ +

◆ CreateTangents() [2/2]

+ +
+
+ + + + + + + + +
void CreateTangents (std::vector< SmoothnesssharpenedEdges)
+
+

Calculates halfedgeTangent_, allowing the manifold to be refined and smoothed. The tangents form weighted cubic Beziers along each edge. This function creates circular arcs where possible (minimizing maximum curvature), constrained to the vertex normals. Where sharpenedEdges are specified, the tangents are shortened that intersect the sharpened edge, concentrating the curvature there, while the tangents of the sharp edges themselves are aligned for continuity.

+ +
+
+ +

◆ Subdivide()

+ +
+
+ + + + + + + + +
Vec< Barycentric > Subdivide (std::function< int(glm::vec3)> edgeDivisions)
+
+

Split each edge into n pieces as defined by calling the edgeDivisions function, and sub-triangulate each triangle accordingly. This function doesn't run Finish(), as that is expensive and it'll need to be run after the new vertices have moved, which is a likely scenario after refinement (smoothing).

+ +
+
+
+
+ + + + diff --git a/docs/html/structmanifold_1_1_mesh_g_l-members.html b/docs/html/structmanifold_1_1_mesh_g_l-members.html new file mode 100644 index 000000000..376b11fd4 --- /dev/null +++ b/docs/html/structmanifold_1_1_mesh_g_l-members.html @@ -0,0 +1,130 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
MeshGL Member List
+
+
+ +

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

+ + + + + + + + + + + + + + + + + +
faceIDMeshGL
halfedgeTangentMeshGL
Merge()MeshGL
mergeFromVertMeshGL
mergeToVertMeshGL
MeshGL()=default (defined in MeshGL)MeshGL
MeshGL(const Mesh &mesh)MeshGL
numPropMeshGL
NumTri() constMeshGLinline
NumVert() constMeshGLinline
precisionMeshGL
runIndexMeshGL
runOriginalIDMeshGL
runTransformMeshGL
triVertsMeshGL
vertPropertiesMeshGL
+
+ + + + diff --git a/docs/html/structmanifold_1_1_mesh_g_l.html b/docs/html/structmanifold_1_1_mesh_g_l.html new file mode 100644 index 000000000..fc9887bd3 --- /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< floatvertProperties
 
std::vector< uint32_ttriVerts
 
std::vector< uint32_tmergeFromVert
 
std::vector< uint32_tmergeToVert
 
std::vector< uint32_trunIndex
 
std::vector< uint32_trunOriginalID
 
std::vector< floatrunTransform
 
std::vector< uint32_tfaceID
 
std::vector< floathalfedgeTangent
 
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..bea09e2ea --- /dev/null +++ b/docs/html/structmanifold_1_1_path_impl-members.html @@ -0,0 +1,117 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
PathImpl Member List
+
+
+ +

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

+ + + + +
operator const C2::PathsD &() const (defined in PathImpl)PathImplinline
PathImpl(const C2::PathsD paths_) (defined in PathImpl)PathImplinline
paths_ (defined in PathImpl)PathImpl
+
+ + + + diff --git a/docs/html/structmanifold_1_1_path_impl.html b/docs/html/structmanifold_1_1_path_impl.html new file mode 100644 index 000000000..fbda7ebf4 --- /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..298cb46b1 --- /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..05e16a7d8 --- /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..f56b0dd53 --- /dev/null +++ b/docs/html/structmanifold_1_1_reindex_edge-members.html @@ -0,0 +1,117 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
ReindexEdge< inverted > Member List
+
+
+ +

This is the complete list of members for ReindexEdge< inverted >, including all inherited members.

+ + + + +
edges (defined in ReindexEdge< inverted >)ReindexEdge< inverted >
indices (defined in ReindexEdge< inverted >)ReindexEdge< inverted >
operator()(size_t i) (defined in ReindexEdge< inverted >)ReindexEdge< inverted >inline
+
+ + + + diff --git a/docs/html/structmanifold_1_1_reindex_edge.html b/docs/html/structmanifold_1_1_reindex_edge.html new file mode 100644 index 000000000..fc2f8ae76 --- /dev/null +++ b/docs/html/structmanifold_1_1_reindex_edge.html @@ -0,0 +1,132 @@ + + + + + + + +Manifold: ReindexEdge< inverted > Struct Template Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
ReindexEdge< inverted > Struct Template Reference
+
+
+ + + + +

+Public Member Functions

+void operator() (size_t i)
 
+ + + + + +

+Public Attributes

+VecView< const TmpEdgeedges
 
+SparseIndicesindices
 
+
+
+ + + + diff --git a/docs/html/structmanifold_1_1_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..69d37dcf9 --- /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..779feae7e --- /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..6ca95dd64 --- /dev/null +++ b/docs/html/structmanifold_1_1_timer-members.html @@ -0,0 +1,120 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Timer Member List
+
+
+ +

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

+ + + + + + + +
Elapsed() (defined in Timer)Timerinline
end (defined in Timer)Timer
Print(std::string message) (defined in Timer)Timerinline
start (defined in Timer)Timer
Start() (defined in Timer)Timerinline
Stop() (defined in Timer)Timerinline
+
+ + + + diff --git a/docs/html/structmanifold_1_1_timer.html b/docs/html/structmanifold_1_1_timer.html new file mode 100644 index 000000000..f6b22f703 --- /dev/null +++ b/docs/html/structmanifold_1_1_timer.html @@ -0,0 +1,141 @@ + + + + + + + +Manifold: Timer Struct Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+ + + + + + + + + + +

+Public Member Functions

+void Start ()
 
+void Stop ()
 
+float Elapsed ()
 
+void Print (std::string message)
 
+ + + + + +

+Public Attributes

+std::chrono::high_resolution_clock::time_point start
 
+std::chrono::high_resolution_clock::time_point end
 
+
+
+ + + + diff --git a/docs/html/structmanifold_1_1_tmp_edge-members.html b/docs/html/structmanifold_1_1_tmp_edge-members.html new file mode 100644 index 000000000..4cb83befc --- /dev/null +++ b/docs/html/structmanifold_1_1_tmp_edge-members.html @@ -0,0 +1,120 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
TmpEdge Member List
+
+
+ +

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

+ + + + + + + +
first (defined in TmpEdge)TmpEdge
halfedgeIdx (defined in TmpEdge)TmpEdge
operator<(const TmpEdge &other) const (defined in TmpEdge)TmpEdgeinline
second (defined in TmpEdge)TmpEdge
TmpEdge() (defined in TmpEdge)TmpEdgeinline
TmpEdge(int start, int end, int idx) (defined in TmpEdge)TmpEdgeinline
+
+ + + + diff --git a/docs/html/structmanifold_1_1_tmp_edge.html b/docs/html/structmanifold_1_1_tmp_edge.html new file mode 100644 index 000000000..a6a931f6b --- /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..98c2c7a40 --- /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..919323487 --- /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_tri_ref-members.html b/docs/html/structmanifold_1_1_tri_ref-members.html new file mode 100644 index 000000000..72e0713e1 --- /dev/null +++ b/docs/html/structmanifold_1_1_tri_ref-members.html @@ -0,0 +1,118 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
TriRef Member List
+
+
+ +

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

+ + + + + +
meshIDTriRef
originalIDTriRef
SameFace(const TriRef &other) const (defined in TriRef)TriRefinline
triTriRef
+
+ + + + diff --git a/docs/html/structmanifold_1_1_tri_ref.html b/docs/html/structmanifold_1_1_tri_ref.html new file mode 100644 index 000000000..58038296f --- /dev/null +++ b/docs/html/structmanifold_1_1_tri_ref.html @@ -0,0 +1,178 @@ + + + + + + + +Manifold: TriRef Struct Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+ + + + +

+Public Member Functions

+bool SameFace (const TriRef &other) const
 
+ + + + + + + +

+Public Attributes

int meshID
 
int originalID
 
int tri
 
+

Member Data Documentation

+ +

◆ meshID

+ +
+
+ + + + +
int meshID
+
+

The unique ID of the mesh instance of this triangle. If .meshID and .tri match for two triangles, then they are coplanar and came from the same face.

+ +
+
+ +

◆ originalID

+ +
+
+ + + + +
int originalID
+
+

The OriginalID of the mesh this triangle came from. This ID is ideal for reapplying properties like UV coordinates to the output mesh.

+ +
+
+ +

◆ tri

+ +
+
+ + + + +
int tri
+
+

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

+ +
+
+
+
+ + + + diff --git a/docs/html/structmanifold_1_1_tri_ref.js b/docs/html/structmanifold_1_1_tri_ref.js new file mode 100644 index 000000000..98cc65108 --- /dev/null +++ b/docs/html/structmanifold_1_1_tri_ref.js @@ -0,0 +1,6 @@ +var structmanifold_1_1_tri_ref = +[ + [ "meshID", "structmanifold_1_1_tri_ref.html#a3552b302dec169446141ae02c7a2dc12", null ], + [ "originalID", "structmanifold_1_1_tri_ref.html#aa09887a4f79bfc78615dbd09d9001fd7", null ], + [ "tri", "structmanifold_1_1_tri_ref.html#a15e0e24263c3a2cc742b9cfcbabedf88", null ] +]; \ No newline at end of file diff --git a/docs/html/structmanifold_1_1_union_find-members.html b/docs/html/structmanifold_1_1_union_find-members.html new file mode 100644 index 000000000..deedc4069 --- /dev/null +++ b/docs/html/structmanifold_1_1_union_find-members.html @@ -0,0 +1,120 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
UnionFind< I, R > Member List
+
+
+ +

This is the complete list of members for UnionFind< I, R >, including all inherited members.

+ + + + + + + +
connectedComponents(std::vector< I > &components) (defined in UnionFind< I, R >)UnionFind< I, R >inline
find(I x) (defined in UnionFind< I, R >)UnionFind< I, R >inline
parents (defined in UnionFind< I, R >)UnionFind< I, R >
ranks (defined in UnionFind< I, R >)UnionFind< I, R >
UnionFind(I numNodes) (defined in UnionFind< I, R >)UnionFind< I, R >inline
unionXY(I x, I y) (defined in UnionFind< I, R >)UnionFind< I, R >inline
+
+ + + + diff --git a/docs/html/structmanifold_1_1_union_find.html b/docs/html/structmanifold_1_1_union_find.html new file mode 100644 index 000000000..1a7c80b0d --- /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< Iparents
 
+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..c0b981323 --- /dev/null +++ b/docs/html/structmanifold_1_1geometry_err.html @@ -0,0 +1,114 @@ + + + + + + + +Manifold: geometryErr Struct Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
geometryErr Struct Reference
+
+
+ +

Inherits runtime_error.

+
+
+ + + + diff --git a/docs/html/structmanifold_1_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..5cf5860ed --- /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..a5840cddf --- /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..edc729f61 --- /dev/null +++ b/docs/html/structmanifold_1_1topology_err.html @@ -0,0 +1,114 @@ + + + + + + + +Manifold: topologyErr Struct Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
topologyErr Struct Reference
+
+
+ +

Inherits runtime_error.

+
+
+ + + + diff --git a/docs/html/structmanifold_1_1user_err.html b/docs/html/structmanifold_1_1user_err.html new file mode 100644 index 000000000..a019abdba --- /dev/null +++ b/docs/html/structmanifold_1_1user_err.html @@ -0,0 +1,114 @@ + + + + + + + +Manifold: userErr Struct Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
userErr Struct Reference
+
+
+ +

Inherits runtime_error.

+
+
+ + + + diff --git a/docs/html/structnb_1_1detail_1_1type__caster_3_01glm_1_1mat_3_01_c_00_01_r_00_01_t_00_01_q_01_4_01_4-members.html b/docs/html/structnb_1_1detail_1_1type__caster_3_01glm_1_1mat_3_01_c_00_01_r_00_01_t_00_01_q_01_4_01_4-members.html new file mode 100644 index 000000000..8f506c6f1 --- /dev/null +++ b/docs/html/structnb_1_1detail_1_1type__caster_3_01glm_1_1mat_3_01_c_00_01_r_00_01_t_00_01_q_01_4_01_4-members.html @@ -0,0 +1,119 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
type_caster< glm::mat< C, R, T, Q > > Member List
+
+
+ +

This is the complete list of members for type_caster< glm::mat< C, R, T, Q > >, including all inherited members.

+ + + + + + +
from_cpp(glm_type mat, rv_policy policy, cleanup_list *cleanup) noexcept (defined in type_caster< glm::mat< C, R, T, Q > >)type_caster< glm::mat< C, R, T, Q > >inlinestatic
from_python(handle src, uint8_t flags, cleanup_list *cleanup) noexcept (defined in type_caster< glm::mat< C, R, T, Q > >)type_caster< glm::mat< C, R, T, Q > >inline
glm_type typedef (defined in type_caster< glm::mat< C, R, T, Q > >)type_caster< glm::mat< C, R, T, Q > >
NB_TYPE_CASTER(glm_type, const_name(glm_name< glm_type >::name)) (defined in type_caster< glm::mat< C, R, T, Q > >)type_caster< glm::mat< C, R, T, Q > >
numpy_type typedef (defined in type_caster< glm::mat< C, R, T, Q > >)type_caster< glm::mat< C, R, T, Q > >
+
+ + + + diff --git a/docs/html/structnb_1_1detail_1_1type__caster_3_01glm_1_1mat_3_01_c_00_01_r_00_01_t_00_01_q_01_4_01_4.html b/docs/html/structnb_1_1detail_1_1type__caster_3_01glm_1_1mat_3_01_c_00_01_r_00_01_t_00_01_q_01_4_01_4.html new file mode 100644 index 000000000..478330eae --- /dev/null +++ b/docs/html/structnb_1_1detail_1_1type__caster_3_01glm_1_1mat_3_01_c_00_01_r_00_01_t_00_01_q_01_4_01_4.html @@ -0,0 +1,142 @@ + + + + + + + +Manifold: type_caster< glm::mat< C, R, T, Q > > Struct Template Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
type_caster< glm::mat< C, R, T, Q > > Struct Template Reference
+
+
+ + + + + + +

+Public Types

+using glm_type = glm::mat< C, R, T, Q >
 
+using numpy_type = nb::ndarray< nb::numpy, T, nb::shape< R, C > >
 
+ + + + + +

+Public Member Functions

NB_TYPE_CASTER (glm_type, const_name(glm_name< glm_type >::name))
 
+bool from_python (handle src, uint8_t flags, cleanup_list *cleanup) noexcept
 
+ + + +

+Static Public Member Functions

+static handle from_cpp (glm_type mat, rv_policy policy, cleanup_list *cleanup) noexcept
 
+
+
+ + + + diff --git a/docs/html/structnb_1_1detail_1_1type__caster_3_01glm_1_1vec_3_01_n_00_01_t_00_01_q_01_4_01_4-members.html b/docs/html/structnb_1_1detail_1_1type__caster_3_01glm_1_1vec_3_01_n_00_01_t_00_01_q_01_4_01_4-members.html new file mode 100644 index 000000000..babbc0050 --- /dev/null +++ b/docs/html/structnb_1_1detail_1_1type__caster_3_01glm_1_1vec_3_01_n_00_01_t_00_01_q_01_4_01_4-members.html @@ -0,0 +1,118 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
type_caster< glm::vec< N, T, Q > > Member List
+
+
+ +

This is the complete list of members for type_caster< glm::vec< N, T, Q > >, including all inherited members.

+ + + + + +
from_cpp(glm_type vec, rv_policy policy, cleanup_list *cleanup) noexcept (defined in type_caster< glm::vec< N, T, Q > >)type_caster< glm::vec< N, T, Q > >inlinestatic
from_python(handle src, uint8_t flags, cleanup_list *cleanup) noexcept (defined in type_caster< glm::vec< N, T, Q > >)type_caster< glm::vec< N, T, Q > >inline
glm_type typedef (defined in type_caster< glm::vec< N, T, Q > >)type_caster< glm::vec< N, T, Q > >
NB_TYPE_CASTER(glm_type, const_name(glm_name< glm_type >::name)) (defined in type_caster< glm::vec< N, T, Q > >)type_caster< glm::vec< N, T, Q > >
+
+ + + + diff --git a/docs/html/structnb_1_1detail_1_1type__caster_3_01glm_1_1vec_3_01_n_00_01_t_00_01_q_01_4_01_4.html b/docs/html/structnb_1_1detail_1_1type__caster_3_01glm_1_1vec_3_01_n_00_01_t_00_01_q_01_4_01_4.html new file mode 100644 index 000000000..9111adfe7 --- /dev/null +++ b/docs/html/structnb_1_1detail_1_1type__caster_3_01glm_1_1vec_3_01_n_00_01_t_00_01_q_01_4_01_4.html @@ -0,0 +1,139 @@ + + + + + + + +Manifold: type_caster< glm::vec< N, T, Q > > Struct Template Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
type_caster< glm::vec< N, T, Q > > Struct Template Reference
+
+
+ + + + +

+Public Types

+using glm_type = glm::vec< N, T, Q >
 
+ + + + + +

+Public Member Functions

NB_TYPE_CASTER (glm_type, const_name(glm_name< glm_type >::name))
 
+bool from_python (handle src, uint8_t flags, cleanup_list *cleanup) noexcept
 
+ + + +

+Static Public Member Functions

+static handle from_cpp (glm_type vec, rv_policy policy, cleanup_list *cleanup) noexcept
 
+
+
+ + + + diff --git a/docs/html/structnb_1_1detail_1_1type__caster_3_01manifold_1_1_vec_view_3_01glm_1_1vec_3_01_n_00_01_t_00_01_q_01_4_01_4_01_4-members.html b/docs/html/structnb_1_1detail_1_1type__caster_3_01manifold_1_1_vec_view_3_01glm_1_1vec_3_01_n_00_01_t_00_01_q_01_4_01_4_01_4-members.html new file mode 100644 index 000000000..fd1afda2e --- /dev/null +++ b/docs/html/structnb_1_1detail_1_1type__caster_3_01manifold_1_1_vec_view_3_01glm_1_1vec_3_01_n_00_01_t_00_01_q_01_4_01_4_01_4-members.html @@ -0,0 +1,119 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
type_caster< manifold::VecView< glm::vec< N, T, Q > > > Member List
+
+
+ +

This is the complete list of members for type_caster< manifold::VecView< glm::vec< N, T, Q > > >, including all inherited members.

+ + + + + + +
from_cpp(Value vec, rv_policy policy, cleanup_list *cleanup) noexcept (defined in type_caster< manifold::VecView< glm::vec< N, T, Q > > >)type_caster< manifold::VecView< glm::vec< N, T, Q > > >inlinestatic
from_python(handle src, uint8_t flags, cleanup_list *cleanup) noexcept (defined in type_caster< manifold::VecView< glm::vec< N, T, Q > > >)type_caster< manifold::VecView< glm::vec< N, T, Q > > >inline
glm_type typedef (defined in type_caster< manifold::VecView< glm::vec< N, T, Q > > >)type_caster< manifold::VecView< glm::vec< N, T, Q > > >
NB_TYPE_CASTER(manifold::VecView< glm_type >, const_name(glm_name< glm_type >::multi_name)) (defined in type_caster< manifold::VecView< glm::vec< N, T, Q > > >)type_caster< manifold::VecView< glm::vec< N, T, Q > > >
numpy_type typedef (defined in type_caster< manifold::VecView< glm::vec< N, T, Q > > >)type_caster< manifold::VecView< glm::vec< N, T, Q > > >
+
+ + + + diff --git a/docs/html/structnb_1_1detail_1_1type__caster_3_01manifold_1_1_vec_view_3_01glm_1_1vec_3_01_n_00_01_t_00_01_q_01_4_01_4_01_4.html b/docs/html/structnb_1_1detail_1_1type__caster_3_01manifold_1_1_vec_view_3_01glm_1_1vec_3_01_n_00_01_t_00_01_q_01_4_01_4_01_4.html new file mode 100644 index 000000000..450212554 --- /dev/null +++ b/docs/html/structnb_1_1detail_1_1type__caster_3_01manifold_1_1_vec_view_3_01glm_1_1vec_3_01_n_00_01_t_00_01_q_01_4_01_4_01_4.html @@ -0,0 +1,142 @@ + + + + + + + +Manifold: type_caster< manifold::VecView< glm::vec< N, T, Q > > > Struct Template Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
type_caster< manifold::VecView< glm::vec< N, T, Q > > > Struct Template Reference
+
+
+ + + + + + +

+Public Types

+using glm_type = glm::vec< N, T, Q >
 
+using numpy_type = nb::ndarray< nb::numpy, T, nb::shape< nb::any, N > >
 
+ + + + + +

+Public Member Functions

NB_TYPE_CASTER (manifold::VecView< glm_type >, const_name(glm_name< glm_type >::multi_name))
 
+bool from_python (handle src, uint8_t flags, cleanup_list *cleanup) noexcept
 
+ + + +

+Static Public Member Functions

+static handle from_cpp (Value vec, rv_policy policy, cleanup_list *cleanup) noexcept
 
+
+
+ + + + diff --git a/docs/html/structnb_1_1detail_1_1type__caster_3_01std_1_1vector_3_01glm_1_1vec_3_01_n_00_01_t_00_01_q_01_4_01_4_01_4-members.html b/docs/html/structnb_1_1detail_1_1type__caster_3_01std_1_1vector_3_01glm_1_1vec_3_01_n_00_01_t_00_01_q_01_4_01_4_01_4-members.html new file mode 100644 index 000000000..a251cd96b --- /dev/null +++ b/docs/html/structnb_1_1detail_1_1type__caster_3_01std_1_1vector_3_01glm_1_1vec_3_01_n_00_01_t_00_01_q_01_4_01_4_01_4-members.html @@ -0,0 +1,119 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
type_caster< std::vector< glm::vec< N, T, Q > > > Member List
+
+
+ +

This is the complete list of members for type_caster< std::vector< glm::vec< N, T, Q > > >, including all inherited members.

+ + + + + + +
from_cpp(Value vec, rv_policy policy, cleanup_list *cleanup) noexcept (defined in type_caster< std::vector< glm::vec< N, T, Q > > >)type_caster< std::vector< glm::vec< N, T, Q > > >inlinestatic
from_python(handle src, uint8_t flags, cleanup_list *cleanup) noexcept (defined in type_caster< std::vector< glm::vec< N, T, Q > > >)type_caster< std::vector< glm::vec< N, T, Q > > >inline
glm_type typedef (defined in type_caster< std::vector< glm::vec< N, T, Q > > >)type_caster< std::vector< glm::vec< N, T, Q > > >
NB_TYPE_CASTER(std::vector< glm_type >, const_name(glm_name< glm_type >::multi_name)) (defined in type_caster< std::vector< glm::vec< N, T, Q > > >)type_caster< std::vector< glm::vec< N, T, Q > > >
numpy_type typedef (defined in type_caster< std::vector< glm::vec< N, T, Q > > >)type_caster< std::vector< glm::vec< N, T, Q > > >
+
+ + + + diff --git a/docs/html/structnb_1_1detail_1_1type__caster_3_01std_1_1vector_3_01glm_1_1vec_3_01_n_00_01_t_00_01_q_01_4_01_4_01_4.html b/docs/html/structnb_1_1detail_1_1type__caster_3_01std_1_1vector_3_01glm_1_1vec_3_01_n_00_01_t_00_01_q_01_4_01_4_01_4.html new file mode 100644 index 000000000..b553475db --- /dev/null +++ b/docs/html/structnb_1_1detail_1_1type__caster_3_01std_1_1vector_3_01glm_1_1vec_3_01_n_00_01_t_00_01_q_01_4_01_4_01_4.html @@ -0,0 +1,142 @@ + + + + + + + +Manifold: type_caster< std::vector< glm::vec< N, T, Q > > > Struct Template Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
type_caster< std::vector< glm::vec< N, T, Q > > > Struct Template Reference
+
+
+ + + + + + +

+Public Types

+using glm_type = glm::vec< N, T, Q >
 
+using numpy_type = nb::ndarray< nb::numpy, T, nb::shape< nb::any, N > >
 
+ + + + + +

+Public Member Functions

NB_TYPE_CASTER (std::vector< glm_type >, const_name(glm_name< glm_type >::multi_name))
 
+bool from_python (handle src, uint8_t flags, cleanup_list *cleanup) noexcept
 
+ + + +

+Static Public Member Functions

+static handle from_cpp (Value vec, rv_policy policy, cleanup_list *cleanup) noexcept
 
+
+
+ + + + diff --git a/docs/html/structstd_1_1hash_3_01glm_1_1ivec3_01_4-members.html b/docs/html/structstd_1_1hash_3_01glm_1_1ivec3_01_4-members.html new file mode 100644 index 000000000..faa7df853 --- /dev/null +++ b/docs/html/structstd_1_1hash_3_01glm_1_1ivec3_01_4-members.html @@ -0,0 +1,115 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
hash< glm::ivec3 > Member List
+
+
+ +

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

+ + +
operator()(const glm::ivec3 &p) const (defined in hash< glm::ivec3 >)hash< glm::ivec3 >inline
+
+ + + + diff --git a/docs/html/structstd_1_1hash_3_01glm_1_1ivec3_01_4.html b/docs/html/structstd_1_1hash_3_01glm_1_1ivec3_01_4.html new file mode 100644 index 000000000..01ee74308 --- /dev/null +++ b/docs/html/structstd_1_1hash_3_01glm_1_1ivec3_01_4.html @@ -0,0 +1,122 @@ + + + + + + + +Manifold: hash< glm::ivec3 > Struct Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
hash< glm::ivec3 > Struct Reference
+
+
+ + + + +

+Public Member Functions

+size_t operator() (const glm::ivec3 &p) const
 
+
+
+ + + + diff --git a/docs/html/structstd_1_1hash_3_01std_1_1pair_3_01int_00_01int_01_4_01_4-members.html b/docs/html/structstd_1_1hash_3_01std_1_1pair_3_01int_00_01int_01_4_01_4-members.html new file mode 100644 index 000000000..39f43a3b4 --- /dev/null +++ b/docs/html/structstd_1_1hash_3_01std_1_1pair_3_01int_00_01int_01_4_01_4-members.html @@ -0,0 +1,115 @@ + + + + + + + +Manifold: Member List + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
hash< std::pair< int, int > > Member List
+
+
+ +

This is the complete list of members for hash< std::pair< int, int > >, including all inherited members.

+ + +
operator()(const std::pair< int, int > &p) const (defined in hash< std::pair< int, int > >)hash< std::pair< int, int > >inline
+
+ + + + diff --git a/docs/html/structstd_1_1hash_3_01std_1_1pair_3_01int_00_01int_01_4_01_4.html b/docs/html/structstd_1_1hash_3_01std_1_1pair_3_01int_00_01int_01_4_01_4.html new file mode 100644 index 000000000..c431517e1 --- /dev/null +++ b/docs/html/structstd_1_1hash_3_01std_1_1pair_3_01int_00_01int_01_4_01_4.html @@ -0,0 +1,122 @@ + + + + + + + +Manifold: hash< std::pair< int, int > > Struct Reference + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
hash< std::pair< int, int > > Struct Reference
+
+
+ + + + +

+Public Member Functions

+size_t operator() (const std::pair< int, int > &p) const
 
+
+
+ + + + diff --git a/docs/html/svd_8h_source.html b/docs/html/svd_8h_source.html new file mode 100644 index 000000000..1e4a19b92 --- /dev/null +++ b/docs/html/svd_8h_source.html @@ -0,0 +1,415 @@ + + + + + + + +Manifold: svd.h Source File + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
svd.h
+
+
+
1// MIT License
+
2
+
3// Copyright (c) 2019 wi-re
+
4// Copyright 2023 The Manifold Authors.
+
5
+
6// Permission is hereby granted, free of charge, to any person obtaining a copy
+
7// of this software and associated documentation files (the "Software"), to deal
+
8// in the Software without restriction, including without limitation the rights
+
9// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+
10// copies of the Software, and to permit persons to whom the Software is
+
11// furnished to do so, subject to the following conditions:
+
12
+
13// The above copyright notice and this permission notice shall be included in
+
14// all copies or substantial portions of the Software.
+
15
+
16// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+
17// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
18// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
19// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
20// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+
21// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+
22// SOFTWARE.
+
23
+
24// Modified from https://github.com/wi-re/tbtSVD, removing CUDA dependence and
+
25// approximate inverse square roots.
+
26
+
27#include <algorithm>
+
28#include <cmath>
+
29#include <glm/glm.hpp>
+
30#include <tuple>
+
31#include <utility>
+
32
+
33namespace {
+
34// Constants used for calculation of Givens quaternions
+
35inline constexpr float _gamma = 5.828427124f; // sqrt(8)+3;
+
36inline constexpr float _cStar = 0.923879532f; // cos(pi/8)
+
37inline constexpr float _sStar = 0.3826834323f; // sin(pi/8)
+
38// Threshold value
+
39inline constexpr float _SVD_EPSILON = 1e-6f;
+
40// Iteration counts for Jacobi Eigen Analysis, influences precision
+
41inline constexpr int JACOBI_STEPS = 12;
+
42
+
43// Helper function used to swap X with Y and Y with X if c == true
+
44inline void CondSwap(bool c, float& X, float& Y) {
+
45 float Z = X;
+
46 X = c ? Y : X;
+
47 Y = c ? Z : Y;
+
48}
+
49// Helper function used to swap X with Y and Y with -X if c == true
+
50inline void CondNegSwap(bool c, float& X, float& Y) {
+
51 float Z = -X;
+
52 X = c ? Y : X;
+
53 Y = c ? Z : Y;
+
54}
+
55// A simple symmetric 3x3 Matrix class (contains no storage for (0, 1) (0, 2)
+
56// and (1, 2)
+
57struct Symmetric3x3 {
+
58 float m_00 = 1.f;
+
59 float m_10 = 0.f, m_11 = 1.f;
+
60 float m_20 = 0.f, m_21 = 0.f, m_22 = 1.f;
+
61
+
62 Symmetric3x3(float a11 = 1.f, float a21 = 0.f, float a22 = 1.f,
+
63 float a31 = 0.f, float a32 = 0.f, float a33 = 1.f)
+
64 : m_00(a11), m_10(a21), m_11(a22), m_20(a31), m_21(a32), m_22(a33) {}
+
65 Symmetric3x3(glm::mat3 o)
+
66 : m_00(o[0][0]),
+
67 m_10(o[0][1]),
+
68 m_11(o[1][1]),
+
69 m_20(o[0][2]),
+
70 m_21(o[1][2]),
+
71 m_22(o[2][2]) {}
+
72};
+
73// Helper struct to store 2 floats to avoid OUT parameters on functions
+
74struct Givens {
+
75 float ch = _cStar;
+
76 float sh = _sStar;
+
77};
+
78// Helper struct to store 2 Matrices to avoid OUT parameters on functions
+
79struct QR {
+
80 glm::mat3 Q, R;
+
81};
+
82// Calculates the squared norm of the vector.
+
83inline float Dist2(glm::vec3 v) { return glm::dot(v, v); }
+
84// For an explanation of the math see
+
85// http://pages.cs.wisc.edu/~sifakis/papers/SVD_TR1690.pdf Computing the
+
86// Singular Value Decomposition of 3 x 3 matrices with minimal branching and
+
87// elementary floating point operations See Algorithm 2 in reference. Given a
+
88// matrix A this function returns the Givens quaternion (x and w component, y
+
89// and z are 0)
+
90inline Givens ApproximateGivensQuaternion(Symmetric3x3& A) {
+
91 Givens g{2.f * (A.m_00 - A.m_11), A.m_10};
+
92 bool b = _gamma * g.sh * g.sh < g.ch * g.ch;
+
93 float w = 1.f / sqrt(fmaf(g.ch, g.ch, g.sh * g.sh));
+
94 if (w != w) b = 0;
+
95 return Givens{b ? w * g.ch : (float)_cStar, b ? w * g.sh : (float)_sStar};
+
96}
+
97// Function used to apply a Givens rotation S. Calculates the weights and
+
98// updates the quaternion to contain the cumulative rotation
+
99inline void JacobiConjugation(const int32_t x, const int32_t y, const int32_t z,
+
100 Symmetric3x3& S, glm::vec4& q) {
+
101 auto g = ApproximateGivensQuaternion(S);
+
102 float scale = 1.f / fmaf(g.ch, g.ch, g.sh * g.sh);
+
103 float a = fmaf(g.ch, g.ch, -g.sh * g.sh) * scale;
+
104 float b = 2.f * g.sh * g.ch * scale;
+
105 Symmetric3x3 _S = S;
+
106 // perform conjugation S = Q'*S*Q
+
107 S.m_00 = fmaf(a, fmaf(a, _S.m_00, b * _S.m_10),
+
108 b * (fmaf(a, _S.m_10, b * _S.m_11)));
+
109 S.m_10 = fmaf(a, fmaf(-b, _S.m_00, a * _S.m_10),
+
110 b * (fmaf(-b, _S.m_10, a * _S.m_11)));
+
111 S.m_11 = fmaf(-b, fmaf(-b, _S.m_00, a * _S.m_10),
+
112 a * (fmaf(-b, _S.m_10, a * _S.m_11)));
+
113 S.m_20 = fmaf(a, _S.m_20, b * _S.m_21);
+
114 S.m_21 = fmaf(-b, _S.m_20, a * _S.m_21);
+
115 S.m_22 = _S.m_22;
+
116 // update cumulative rotation qV
+
117 glm::vec3 tmp = g.sh * glm::vec3(q);
+
118 g.sh *= q[3];
+
119 // (x,y,z) corresponds to ((0,1,2),(1,2,0),(2,0,1)) for (p,q) =
+
120 // ((0,1),(1,2),(0,2))
+
121 q[z] = fmaf(q[z], g.ch, g.sh);
+
122 q[3] = fmaf(q[3], g.ch, -tmp[z]); // w
+
123 q[x] = fmaf(q[x], g.ch, tmp[y]);
+
124 q[y] = fmaf(q[y], g.ch, -tmp[x]);
+
125 // re-arrange matrix for next iteration
+
126 _S.m_00 = S.m_11;
+
127 _S.m_10 = S.m_21;
+
128 _S.m_11 = S.m_22;
+
129 _S.m_20 = S.m_10;
+
130 _S.m_21 = S.m_20;
+
131 _S.m_22 = S.m_00;
+
132 S.m_00 = _S.m_00;
+
133 S.m_10 = _S.m_10;
+
134 S.m_11 = _S.m_11;
+
135 S.m_20 = _S.m_20;
+
136 S.m_21 = _S.m_21;
+
137 S.m_22 = _S.m_22;
+
138}
+
139// Function used to contain the Givens permutations and the loop of the jacobi
+
140// steps controlled by JACOBI_STEPS Returns the quaternion q containing the
+
141// cumulative result used to reconstruct S
+
142inline glm::mat3 JacobiEigenAnalysis(Symmetric3x3 S) {
+
143 glm::vec4 q(0, 0, 0, 1);
+
144 for (int32_t i = 0; i < JACOBI_STEPS; i++) {
+
145 JacobiConjugation(0, 1, 2, S, q);
+
146 JacobiConjugation(1, 2, 0, S, q);
+
147 JacobiConjugation(2, 0, 1, S, q);
+
148 }
+
149 return glm::mat3(1.f - 2.f * (fmaf(q.y, q.y, q.z * q.z)), //
+
150 2.f * fmaf(q.x, q.y, +q.w * q.z), //
+
151 2.f * fmaf(q.x, q.z, -q.w * q.y), //
+
152 2 * fmaf(q.x, q.y, -q.w * q.z), //
+
153 1 - 2 * fmaf(q.x, q.x, q.z * q.z), //
+
154 2 * fmaf(q.y, q.z, q.w * q.x), //
+
155 2 * fmaf(q.x, q.z, q.w * q.y), //
+
156 2 * fmaf(q.y, q.z, -q.w * q.x), //
+
157 1 - 2 * fmaf(q.x, q.x, q.y * q.y));
+
158}
+
159// Implementation of Algorithm 3
+
160inline void SortSingularValues(glm::mat3& B, glm::mat3& V) {
+
161 float rho1 = Dist2(B[0]);
+
162 float rho2 = Dist2(B[1]);
+
163 float rho3 = Dist2(B[2]);
+
164 bool c;
+
165 c = rho1 < rho2;
+
166 CondNegSwap(c, B[0][0], B[1][0]);
+
167 CondNegSwap(c, V[0][0], V[1][0]);
+
168 CondNegSwap(c, B[0][1], B[1][1]);
+
169 CondNegSwap(c, V[0][1], V[1][1]);
+
170 CondNegSwap(c, B[0][2], B[1][2]);
+
171 CondNegSwap(c, V[0][2], V[1][2]);
+
172 CondSwap(c, rho1, rho2);
+
173 c = rho1 < rho3;
+
174 CondNegSwap(c, B[0][0], B[2][0]);
+
175 CondNegSwap(c, V[0][0], V[2][0]);
+
176 CondNegSwap(c, B[0][1], B[2][1]);
+
177 CondNegSwap(c, V[0][1], V[2][1]);
+
178 CondNegSwap(c, B[0][2], B[2][2]);
+
179 CondNegSwap(c, V[0][2], V[2][2]);
+
180 CondSwap(c, rho1, rho3);
+
181 c = rho2 < rho3;
+
182 CondNegSwap(c, B[1][0], B[2][0]);
+
183 CondNegSwap(c, V[1][0], V[2][0]);
+
184 CondNegSwap(c, B[1][1], B[2][1]);
+
185 CondNegSwap(c, V[1][1], V[2][1]);
+
186 CondNegSwap(c, B[1][2], B[2][2]);
+
187 CondNegSwap(c, V[1][2], V[2][2]);
+
188}
+
189// Implementation of Algorithm 4
+
190inline Givens QRGivensQuaternion(float a1, float a2) {
+
191 // a1 = pivot point on diagonal
+
192 // a2 = lower triangular entry we want to annihilate
+
193 float epsilon = (float)_SVD_EPSILON;
+
194 float rho = sqrt(fmaf(a1, a1, +a2 * a2));
+
195 Givens g{fabsf(a1) + fmaxf(rho, epsilon), rho > epsilon ? a2 : 0};
+
196 bool b = a1 < 0.f;
+
197 CondSwap(b, g.sh, g.ch);
+
198 float w = 1.f / sqrt(fmaf(g.ch, g.ch, g.sh * g.sh));
+
199 g.ch *= w;
+
200 g.sh *= w;
+
201 return g;
+
202}
+
203// Implements a QR decomposition of a Matrix, see Sec 4.2
+
204inline QR QRDecomposition(glm::mat3& B) {
+
205 glm::mat3 Q, R;
+
206 // first Givens rotation (ch,0,0,sh)
+
207 auto g1 = QRGivensQuaternion(B[0][0], B[0][1]);
+
208 auto a = fmaf(-2.f, g1.sh * g1.sh, 1.f);
+
209 auto b = 2.f * g1.ch * g1.sh;
+
210 // apply B = Q' * B
+
211 R[0][0] = fmaf(a, B[0][0], b * B[0][1]);
+
212 R[1][0] = fmaf(a, B[1][0], b * B[1][1]);
+
213 R[2][0] = fmaf(a, B[2][0], b * B[2][1]);
+
214 R[0][1] = fmaf(-b, B[0][0], a * B[0][1]);
+
215 R[1][1] = fmaf(-b, B[1][0], a * B[1][1]);
+
216 R[2][1] = fmaf(-b, B[2][0], a * B[2][1]);
+
217 R[0][2] = B[0][2];
+
218 R[1][2] = B[1][2];
+
219 R[2][2] = B[2][2];
+
220 // second Givens rotation (ch,0,-sh,0)
+
221 auto g2 = QRGivensQuaternion(R[0][0], R[0][2]);
+
222 a = fmaf(-2.f, g2.sh * g2.sh, 1.f);
+
223 b = 2.f * g2.ch * g2.sh;
+
224 // apply B = Q' * B;
+
225 B[0][0] = fmaf(a, R[0][0], b * R[0][2]);
+
226 B[1][0] = fmaf(a, R[1][0], b * R[1][2]);
+
227 B[2][0] = fmaf(a, R[2][0], b * R[2][2]);
+
228 B[0][1] = R[0][1];
+
229 B[1][1] = R[1][1];
+
230 B[2][1] = R[2][1];
+
231 B[0][2] = fmaf(-b, R[0][0], a * R[0][2]);
+
232 B[1][2] = fmaf(-b, R[1][0], a * R[1][2]);
+
233 B[2][2] = fmaf(-b, R[2][0], a * R[2][2]);
+
234 // third Givens rotation (ch,sh,0,0)
+
235 auto g3 = QRGivensQuaternion(B[1][1], B[1][2]);
+
236 a = fmaf(-2.f, g3.sh * g3.sh, 1.f);
+
237 b = 2.f * g3.ch * g3.sh;
+
238 // R is now set to desired value
+
239 R[0][0] = B[0][0];
+
240 R[1][0] = B[1][0];
+
241 R[2][0] = B[2][0];
+
242 R[0][1] = fmaf(a, B[0][1], b * B[0][2]);
+
243 R[1][1] = fmaf(a, B[1][1], b * B[1][2]);
+
244 R[2][1] = fmaf(a, B[2][1], b * B[2][2]);
+
245 R[0][2] = fmaf(-b, B[0][1], a * B[0][2]);
+
246 R[1][2] = fmaf(-b, B[1][1], a * B[1][2]);
+
247 R[2][2] = fmaf(-b, B[2][1], a * B[2][2]);
+
248 // construct the cumulative rotation Q=Q1 * Q2 * Q3
+
249 // the number of floating point operations for three quaternion
+
250 // multiplications is more or less comparable to the explicit form of the
+
251 // joined matrix. certainly more memory-efficient!
+
252 auto sh12 = 2.f * fmaf(g1.sh, g1.sh, -0.5f);
+
253 auto sh22 = 2.f * fmaf(g2.sh, g2.sh, -0.5f);
+
254 auto sh32 = 2.f * fmaf(g3.sh, g3.sh, -0.5f);
+
255 Q[0][0] = sh12 * sh22;
+
256 Q[1][0] = fmaf(4.f * g2.ch * g3.ch, sh12 * g2.sh * g3.sh,
+
257 2.f * g1.ch * g1.sh * sh32);
+
258 Q[2][0] = fmaf(4.f * g1.ch * g3.ch, g1.sh * g3.sh,
+
259 -2.f * g2.ch * sh12 * g2.sh * sh32);
+
260
+
261 Q[0][1] = -2.f * g1.ch * g1.sh * sh22;
+
262 Q[1][1] =
+
263 fmaf(-8.f * g1.ch * g2.ch * g3.ch, g1.sh * g2.sh * g3.sh, sh12 * sh32);
+
264 Q[2][1] = fmaf(
+
265 -2.f * g3.ch, g3.sh,
+
266 4.f * g1.sh * fmaf(g3.ch * g1.sh, g3.sh, g1.ch * g2.ch * g2.sh * sh32));
+
267
+
268 Q[0][2] = 2.f * g2.ch * g2.sh;
+
269 Q[1][2] = -2.f * g3.ch * sh22 * g3.sh;
+
270 Q[2][2] = sh22 * sh32;
+
271 return QR{Q, R};
+
272}
+
273} // namespace
+
274
+
275namespace manifold {
+
+
283struct SVDSet {
+
284 glm::mat3 U, S, V;
+
285};
+
+
286
+
+
292inline SVDSet SVD(glm::mat3 A) {
+
293 glm::mat3 V = JacobiEigenAnalysis(glm::transpose(A) * A);
+
294 auto B = A * V;
+ +
296 QR qr = QRDecomposition(B);
+
297 return SVDSet{qr.Q, qr.R, V};
+
298}
+
+
299
+
+
305inline float SpectralNorm(glm::mat3 A) {
+
306 SVDSet usv = SVD(A);
+
307 return usv.S[0][0];
+
308}
+
+
310} // namespace manifold
+
Definition vec_view.h:27
+
float SpectralNorm(glm::mat3 A)
Definition svd.h:305
+
SVDSet SVD(glm::mat3 A)
Definition svd.h:292
+
Definition svd.h:283
+
Definition meshIO.h:20
+
+
+ + + + diff --git a/docs/html/sync_off.png b/docs/html/sync_off.png new file mode 100644 index 000000000..3b443fc62 Binary files /dev/null and b/docs/html/sync_off.png differ diff --git a/docs/html/sync_on.png b/docs/html/sync_on.png new file mode 100644 index 000000000..e08320fb6 Binary files /dev/null and b/docs/html/sync_on.png differ diff --git a/docs/html/tab_a.png b/docs/html/tab_a.png new file mode 100644 index 000000000..3b725c41c Binary files /dev/null and b/docs/html/tab_a.png differ diff --git a/docs/html/tab_ad.png b/docs/html/tab_ad.png new file mode 100644 index 000000000..e34850acf Binary files /dev/null and b/docs/html/tab_ad.png differ diff --git a/docs/html/tab_b.png b/docs/html/tab_b.png new file mode 100644 index 000000000..e2b4a8638 Binary files /dev/null and b/docs/html/tab_b.png differ diff --git a/docs/html/tab_bd.png b/docs/html/tab_bd.png new file mode 100644 index 000000000..91c252498 Binary files /dev/null and b/docs/html/tab_bd.png differ diff --git a/docs/html/tab_h.png b/docs/html/tab_h.png new file mode 100644 index 000000000..fd5cb7054 Binary files /dev/null and b/docs/html/tab_h.png differ diff --git a/docs/html/tab_hd.png b/docs/html/tab_hd.png new file mode 100644 index 000000000..2489273d4 Binary files /dev/null and b/docs/html/tab_hd.png differ diff --git a/docs/html/tab_s.png b/docs/html/tab_s.png new file mode 100644 index 000000000..ab478c95b Binary files /dev/null and b/docs/html/tab_s.png differ diff --git a/docs/html/tab_sd.png b/docs/html/tab_sd.png new file mode 100644 index 000000000..757a565ce Binary files /dev/null and b/docs/html/tab_sd.png differ diff --git a/docs/html/tabs.css b/docs/html/tabs.css new file mode 100644 index 000000000..71c8a4704 --- /dev/null +++ b/docs/html/tabs.css @@ -0,0 +1 @@ +.sm{position:relative;z-index:9999}.sm,.sm ul,.sm li{display:block;list-style:none;margin:0;padding:0;line-height:normal;direction:ltr;text-align:left;-webkit-tap-highlight-color:rgba(0,0,0,0)}.sm-rtl,.sm-rtl ul,.sm-rtl li{direction:rtl;text-align:right}.sm>li>h1,.sm>li>h2,.sm>li>h3,.sm>li>h4,.sm>li>h5,.sm>li>h6{margin:0;padding:0}.sm ul{display:none}.sm li,.sm a{position:relative}.sm a{display:block}.sm a.disabled{cursor:not-allowed}.sm:after{content:"\00a0";display:block;height:0;font:0/0 serif;clear:both;visibility:hidden;overflow:hidden}.sm,.sm *,.sm *:before,.sm *:after{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.main-menu-btn{position:relative;display:inline-block;width:36px;height:36px;text-indent:36px;margin-left:8px;white-space:nowrap;overflow:hidden;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0)}.main-menu-btn-icon,.main-menu-btn-icon:before,.main-menu-btn-icon:after{position:absolute;top:50%;left:2px;height:2px;width:24px;background:var(--nav-menu-button-color);-webkit-transition:all .25s;transition:all .25s}.main-menu-btn-icon:before{content:'';top:-7px;left:0}.main-menu-btn-icon:after{content:'';top:7px;left:0}#main-menu-state:checked ~ .main-menu-btn .main-menu-btn-icon{height:0}#main-menu-state:checked ~ .main-menu-btn .main-menu-btn-icon:before{top:0;-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}#main-menu-state:checked ~ .main-menu-btn .main-menu-btn-icon:after{top:0;-webkit-transform:rotate(45deg);transform:rotate(45deg)}#main-menu-state{position:absolute;width:1px;height:1px;margin:-1px;border:0;padding:0;overflow:hidden;clip:rect(1px,1px,1px,1px)}#main-menu-state:not(:checked) ~ #main-menu{display:none}#main-menu-state:checked ~ #main-menu{display:block}@media(min-width:768px){.main-menu-btn{position:absolute;top:-99999px}#main-menu-state:not(:checked) ~ #main-menu{display:block}}.sm-dox{background-image:var(--nav-gradient-image)}.sm-dox a,.sm-dox a:focus,.sm-dox a:hover,.sm-dox a:active{padding:0 12px;padding-right:43px;font-family:var(--font-family-nav);font-size:13px;font-weight:bold;line-height:36px;text-decoration:none;text-shadow:var(--nav-text-normal-shadow);color:var(--nav-text-normal-color);outline:0}.sm-dox a:hover{background-image:var(--nav-gradient-active-image);background-repeat:repeat-x;color:var(--nav-text-hover-color);text-shadow:var(--nav-text-hover-shadow)}.sm-dox a.current{color:#d23600}.sm-dox a.disabled{color:#bbb}.sm-dox a span.sub-arrow{position:absolute;top:50%;margin-top:-14px;left:auto;right:3px;width:28px;height:28px;overflow:hidden;font:bold 12px/28px monospace !important;text-align:center;text-shadow:none;background:var(--nav-menu-toggle-color);-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px}.sm-dox a span.sub-arrow:before{display:block;content:'+'}.sm-dox a.highlighted span.sub-arrow:before{display:block;content:'-'}.sm-dox>li:first-child>a,.sm-dox>li:first-child>:not(ul) a{-moz-border-radius:5px 5px 0 0;-webkit-border-radius:5px;border-radius:5px 5px 0 0}.sm-dox>li:last-child>a,.sm-dox>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul{-moz-border-radius:0 0 5px 5px;-webkit-border-radius:0;border-radius:0 0 5px 5px}.sm-dox>li:last-child>a.highlighted,.sm-dox>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}.sm-dox ul{background:var(--nav-menu-background-color)}.sm-dox ul a,.sm-dox ul a:focus,.sm-dox ul a:hover,.sm-dox ul a:active{font-size:12px;border-left:8px solid transparent;line-height:36px;text-shadow:none;background-color:var(--nav-menu-background-color);background-image:none}.sm-dox ul a:hover{background-image:var(--nav-gradient-active-image);background-repeat:repeat-x;color:var(--nav-text-hover-color);text-shadow:0 1px 1px black}.sm-dox ul ul a,.sm-dox ul ul a:hover,.sm-dox ul ul a:focus,.sm-dox ul ul a:active{border-left:16px solid transparent}.sm-dox ul ul ul a,.sm-dox ul ul ul a:hover,.sm-dox ul ul ul a:focus,.sm-dox ul ul ul a:active{border-left:24px solid transparent}.sm-dox ul ul ul ul a,.sm-dox ul ul ul ul a:hover,.sm-dox ul ul ul ul a:focus,.sm-dox ul ul ul ul a:active{border-left:32px solid transparent}.sm-dox ul ul ul ul ul a,.sm-dox ul ul ul ul ul a:hover,.sm-dox ul ul ul ul ul a:focus,.sm-dox ul ul ul ul ul a:active{border-left:40px solid transparent}@media(min-width:768px){.sm-dox ul{position:absolute;width:12em}.sm-dox li{float:left}.sm-dox.sm-rtl li{float:right}.sm-dox ul li,.sm-dox.sm-rtl ul li,.sm-dox.sm-vertical li{float:none}.sm-dox a{white-space:nowrap}.sm-dox ul a,.sm-dox.sm-vertical a{white-space:normal}.sm-dox .sm-nowrap>li>a,.sm-dox .sm-nowrap>li>:not(ul) a{white-space:nowrap}.sm-dox{padding:0 10px;background-image:var(--nav-gradient-image);line-height:36px}.sm-dox a span.sub-arrow{top:50%;margin-top:-2px;right:12px;width:0;height:0;border-width:4px;border-style:solid dashed dashed dashed;border-color:var(--nav-text-normal-color) transparent transparent transparent;background:transparent;-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}.sm-dox a,.sm-dox a:focus,.sm-dox a:active,.sm-dox a:hover,.sm-dox a.highlighted{padding:0 12px;background-image:var(--nav-separator-image);background-repeat:no-repeat;background-position:right;-moz-border-radius:0 !important;-webkit-border-radius:0;border-radius:0 !important}.sm-dox a:hover{background-image:var(--nav-gradient-active-image);background-repeat:repeat-x;color:var(--nav-text-hover-color);text-shadow:var(--nav-text-hover-shadow)}.sm-dox a:hover span.sub-arrow{border-color:var(--nav-text-hover-color) transparent transparent transparent}.sm-dox a.has-submenu{padding-right:24px}.sm-dox li{border-top:0}.sm-dox>li>ul:before,.sm-dox>li>ul:after{content:'';position:absolute;top:-18px;left:30px;width:0;height:0;overflow:hidden;border-width:9px;border-style:dashed dashed solid dashed;border-color:transparent transparent #bbb transparent}.sm-dox>li>ul:after{top:-16px;left:31px;border-width:8px;border-color:transparent transparent var(--nav-menu-background-color) transparent}.sm-dox ul{border:1px solid #bbb;padding:5px 0;background:var(--nav-menu-background-color);-moz-border-radius:5px !important;-webkit-border-radius:5px;border-radius:5px !important;-moz-box-shadow:0 5px 9px rgba(0,0,0,0.2);-webkit-box-shadow:0 5px 9px rgba(0,0,0,0.2);box-shadow:0 5px 9px rgba(0,0,0,0.2)}.sm-dox ul a span.sub-arrow{right:8px;top:50%;margin-top:-5px;border-width:5px;border-color:transparent transparent transparent var(--nav-menu-foreground-color);border-style:dashed dashed dashed solid}.sm-dox ul a,.sm-dox ul a:hover,.sm-dox ul a:focus,.sm-dox ul a:active,.sm-dox ul a.highlighted{color:var(--nav-menu-foreground-color);background-image:none;border:0 !important;color:var(--nav-menu-foreground-color);background-image:none}.sm-dox ul a:hover{background-image:var(--nav-gradient-active-image);background-repeat:repeat-x;color:var(--nav-text-hover-color);text-shadow:var(--nav-text-hover-shadow)}.sm-dox ul a:hover span.sub-arrow{border-color:transparent transparent transparent var(--nav-text-hover-color)}.sm-dox span.scroll-up,.sm-dox span.scroll-down{position:absolute;display:none;visibility:hidden;overflow:hidden;background:var(--nav-menu-background-color);height:36px}.sm-dox span.scroll-up:hover,.sm-dox span.scroll-down:hover{background:#eee}.sm-dox span.scroll-up:hover span.scroll-up-arrow,.sm-dox span.scroll-up:hover span.scroll-down-arrow{border-color:transparent transparent #d23600 transparent}.sm-dox span.scroll-down:hover span.scroll-down-arrow{border-color:#d23600 transparent transparent transparent}.sm-dox span.scroll-up-arrow,.sm-dox span.scroll-down-arrow{position:absolute;top:0;left:50%;margin-left:-6px;width:0;height:0;overflow:hidden;border-width:6px;border-style:dashed dashed solid dashed;border-color:transparent transparent var(--nav-menu-foreground-color) transparent}.sm-dox span.scroll-down-arrow{top:8px;border-style:solid dashed dashed dashed;border-color:var(--nav-menu-foreground-color) transparent transparent transparent}.sm-dox.sm-rtl a.has-submenu{padding-right:12px;padding-left:24px}.sm-dox.sm-rtl a span.sub-arrow{right:auto;left:12px}.sm-dox.sm-rtl.sm-vertical a.has-submenu{padding:10px 20px}.sm-dox.sm-rtl.sm-vertical a span.sub-arrow{right:auto;left:8px;border-style:dashed solid dashed dashed;border-color:transparent #555 transparent transparent}.sm-dox.sm-rtl>li>ul:before{left:auto;right:30px}.sm-dox.sm-rtl>li>ul:after{left:auto;right:31px}.sm-dox.sm-rtl ul a.has-submenu{padding:10px 20px !important}.sm-dox.sm-rtl ul a span.sub-arrow{right:auto;left:8px;border-style:dashed solid dashed dashed;border-color:transparent #555 transparent transparent}.sm-dox.sm-vertical{padding:10px 0;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px}.sm-dox.sm-vertical a{padding:10px 20px}.sm-dox.sm-vertical a:hover,.sm-dox.sm-vertical a:focus,.sm-dox.sm-vertical a:active,.sm-dox.sm-vertical a.highlighted{background:#fff}.sm-dox.sm-vertical a.disabled{background-image:var(--nav-gradient-image)}.sm-dox.sm-vertical a span.sub-arrow{right:8px;top:50%;margin-top:-5px;border-width:5px;border-style:dashed dashed dashed solid;border-color:transparent transparent transparent #555}.sm-dox.sm-vertical>li>ul:before,.sm-dox.sm-vertical>li>ul:after{display:none}.sm-dox.sm-vertical ul a{padding:10px 20px}.sm-dox.sm-vertical ul a:hover,.sm-dox.sm-vertical ul a:focus,.sm-dox.sm-vertical ul a:active,.sm-dox.sm-vertical ul a.highlighted{background:#eee}.sm-dox.sm-vertical ul a.disabled{background:var(--nav-menu-background-color)}} \ No newline at end of file diff --git a/docs/html/test_8h_source.html b/docs/html/test_8h_source.html new file mode 100644 index 000000000..3bd9e3443 --- /dev/null +++ b/docs/html/test_8h_source.html @@ -0,0 +1,195 @@ + + + + + + + +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#ifdef MANIFOLD_EXPORT
+
23#include "meshIO.h"
+
24#endif
+
25
+
26// somehow gcc11 + gtest 1.11.0 is unable to print glm::ivec3
+
27namespace glm {
+
28inline void PrintTo(const ivec3& point, std::ostream* os) {
+
29 *os << "(" << point.x << "," << point.y << "," << point.x << ")";
+
30}
+
31} // namespace glm
+
32
+
33using namespace manifold;
+
34
+
+
35struct Options {
+
36 bool exportModels = false;
+
37 manifold::ExecutionParams params = {};
+
38};
+
+
39
+
40extern Options options;
+
41
+
+
42struct MeshSize {
+
43 int numVert, numTri;
+
44 int numProp = 0;
+
45 int numPropVert = numVert;
+
46};
+
+
47
+
48Polygons SquareHole(float xOffset = 0.0);
+
49Mesh Csaszar();
+
50Mesh Gyroid();
+
51Mesh Tet();
+
52MeshGL TetGL();
+
53MeshGL CubeSTL();
+
54MeshGL WithIndexColors(const Mesh& in);
+
55MeshGL WithPositionColors(const Manifold& in);
+
56MeshGL WithNormals(const Manifold& in);
+
57MeshGL CubeUV();
+
58float GetMaxProperty(const MeshGL& mesh, int channel);
+
59float GetMinProperty(const MeshGL& mesh, int channel);
+
60void Identical(const Mesh& mesh1, const Mesh& mesh2);
+
61void RelatedGL(const Manifold& out, const std::vector<MeshGL>& originals,
+
62 bool checkNormals = false, bool updateNormals = false);
+
63void ExpectMeshes(const Manifold& manifold,
+
64 const std::vector<MeshSize>& meshSize);
+
65void CheckNormals(const Manifold& manifold);
+
66void CheckStrictly(const Manifold& manifold);
+
67void CheckGL(const Manifold& manifold);
+
68#ifdef MANIFOLD_EXPORT
+
69Manifold ReadMesh(const std::string& filename);
+
70#endif
+
Definition manifold.h:148
+
Definition vec_view.h:27
+
std::vector< SimplePolygon > Polygons
Definition public.h:124
+
Definition public.h:129
+
Definition public.h:604
+
Definition meshIO.h:20
+
Definition test.h:42
+
Definition test.h:35
+
Definition manifold.h:47
+
+
+ + + + diff --git a/docs/html/topics.html b/docs/html/topics.html new file mode 100644 index 000000000..611fde59c --- /dev/null +++ b/docs/html/topics.html @@ -0,0 +1,122 @@ + + + + + + + +Manifold: Topics + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Topics
+
+
+
Here is a list of all topics with brief descriptions:
+
[detail level 12]
+ + + + + + + +
 MeshIO3D model file I/O based on Assimp
 SamplesExamples of usage and interesting designs
 CoreThe central classes of the library
 ConnectionsMove data in and out of the Manifold class
 DebugDebugging features
 ExceptionsCustom Exceptions
 PrivateInternal classes of the library; not currently part of the public API
+
+
+
+ + + + diff --git a/docs/html/topics.js b/docs/html/topics.js new file mode 100644 index 000000000..fd224ebc0 --- /dev/null +++ b/docs/html/topics.js @@ -0,0 +1,9 @@ +var topics = +[ + [ "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/tri__dist_8h_source.html b/docs/html/tri__dist_8h_source.html new file mode 100644 index 000000000..8f99adbbb --- /dev/null +++ b/docs/html/tri__dist_8h_source.html @@ -0,0 +1,329 @@ + + + + + + + +Manifold: tri_dist.h Source File + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
tri_dist.h
+
+
+
1// Copyright 2024 The Manifold Authors.
+
2//
+
3// Licensed under the Apache License, Version 2.0 (the "License");
+
4// you may not use this file except in compliance with the License.
+
5// You may obtain a copy of the License at
+
6//
+
7// http://www.apache.org/licenses/LICENSE-2.0
+
8//
+
9// Unless required by applicable law or agreed to in writing, software
+
10// distributed under the License is distributed on an "AS IS" BASIS,
+
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+
12// See the License for the specific language governing permissions and
+
13// limitations under the License.
+
14
+
15#pragma once
+
16
+
17#include <array>
+
18#include <glm/glm.hpp>
+
19
+
20namespace manifold {
+
21
+
22// From NVIDIA-Omniverse PhysX - BSD 3-Clause "New" or "Revised" License
+
23// https://github.com/NVIDIA-Omniverse/PhysX/blob/main/LICENSE.md
+
24// https://github.com/NVIDIA-Omniverse/PhysX/blob/main/physx/source/geomutils/src/sweep/GuSweepCapsuleCapsule.cpp
+
25// With minor modifications
+
26
+
+
37inline void EdgeEdgeDist(glm::vec3& x, glm::vec3& y, // closest points
+
38 const glm::vec3& p,
+
39 const glm::vec3& a, // seg 1 origin, vector
+
40 const glm::vec3& q,
+
41 const glm::vec3& b) // seg 2 origin, vector
+
42{
+
43 const glm::vec3 T = q - p;
+
44 const float ADotA = glm::dot(a, a);
+
45 const float BDotB = glm::dot(b, b);
+
46 const float ADotB = glm::dot(a, b);
+
47 const float ADotT = glm::dot(a, T);
+
48 const float BDotT = glm::dot(b, T);
+
49
+
50 // t parameterizes ray (p, a)
+
51 // u parameterizes ray (q, b)
+
52
+
53 // Compute t for the closest point on ray (p, a) to ray (q, b)
+
54 const float Denom = ADotA * BDotB - ADotB * ADotB;
+
55
+
56 float t; // We will clamp result so t is on the segment (p, a)
+
57 t = Denom != 0.0f
+
58 ? glm::clamp((ADotT * BDotB - BDotT * ADotB) / Denom, 0.0f, 1.0f)
+
59 : 0.0f;
+
60
+
61 // find u for point on ray (q, b) closest to point at t
+
62 float u;
+
63 if (BDotB != 0.0f) {
+
64 u = (t * ADotB - BDotT) / BDotB;
+
65
+
66 // if u is on segment (q, b), t and u correspond to closest points,
+
67 // otherwise, clamp u, recompute and clamp t
+
68 if (u < 0.0f) {
+
69 u = 0.0f;
+
70 t = ADotA != 0.0f ? glm::clamp(ADotT / ADotA, 0.0f, 1.0f) : 0.0f;
+
71 } else if (u > 1.0f) {
+
72 u = 1.0f;
+
73 t = ADotA != 0.0f ? glm::clamp((ADotB + ADotT) / ADotA, 0.0f, 1.0f)
+
74 : 0.0f;
+
75 }
+
76 } else {
+
77 u = 0.0f;
+
78 t = ADotA != 0.0f ? glm::clamp(ADotT / ADotA, 0.0f, 1.0f) : 0.0f;
+
79 }
+
80 x = p + a * t;
+
81 y = q + b * u;
+
82}
+
+
83
+
84// From NVIDIA-Omniverse PhysX - BSD 3-Clause "New" or "Revised" License
+
85// https://github.com/NVIDIA-Omniverse/PhysX/blob/main/LICENSE.md
+
86// https://github.com/NVIDIA-Omniverse/PhysX/blob/main/physx/source/geomutils/src/distance/GuDistanceTriangleTriangle.cpp
+
87// With minor modifications
+
88
+
+ +
96 const std::array<glm::vec3, 3>& p, const std::array<glm::vec3, 3>& q) {
+
97 std::array<glm::vec3, 3> Sv;
+
98 Sv[0] = p[1] - p[0];
+
99 Sv[1] = p[2] - p[1];
+
100 Sv[2] = p[0] - p[2];
+
101
+
102 std::array<glm::vec3, 3> Tv;
+
103 Tv[0] = q[1] - q[0];
+
104 Tv[1] = q[2] - q[1];
+
105 Tv[2] = q[0] - q[2];
+
106
+
107 bool shown_disjoint = false;
+
108
+
109 float mindd = std::numeric_limits<float>::max();
+
110
+
111 for (uint32_t i = 0; i < 3; i++) {
+
112 for (uint32_t j = 0; j < 3; j++) {
+
113 glm::vec3 cp;
+
114 glm::vec3 cq;
+
115 EdgeEdgeDist(cp, cq, p[i], Sv[i], q[j], Tv[j]);
+
116 const glm::vec3 V = cq - cp;
+
117 const float dd = glm::dot(V, V);
+
118
+
119 if (dd <= mindd) {
+
120 mindd = dd;
+
121
+
122 uint32_t id = i + 2;
+
123 if (id >= 3) id -= 3;
+
124 glm::vec3 Z = p[id] - cp;
+
125 float a = glm::dot(Z, V);
+
126 id = j + 2;
+
127 if (id >= 3) id -= 3;
+
128 Z = q[id] - cq;
+
129 float b = glm::dot(Z, V);
+
130
+
131 if ((a <= 0.0f) && (b >= 0.0f)) {
+
132 return glm::dot(V, V);
+
133 };
+
134
+
135 if (a <= 0.0f)
+
136 a = 0.0f;
+
137 else if (b > 0.0f)
+
138 b = 0.0f;
+
139
+
140 if ((mindd - a + b) > 0.0f) shown_disjoint = true;
+
141 }
+
142 }
+
143 }
+
144
+
145 glm::vec3 Sn = glm::cross(Sv[0], Sv[1]);
+
146 float Snl = glm::dot(Sn, Sn);
+
147
+
148 if (Snl > 1e-15f) {
+
149 const glm::vec3 Tp(glm::dot(p[0] - q[0], Sn), glm::dot(p[0] - q[1], Sn),
+
150 glm::dot(p[0] - q[2], Sn));
+
151
+
152 int index = -1;
+
153 if ((Tp[0] > 0.0f) && (Tp[1] > 0.0f) && (Tp[2] > 0.0f)) {
+
154 index = Tp[0] < Tp[1] ? 0 : 1;
+
155 if (Tp[2] < Tp[index]) index = 2;
+
156 } else if ((Tp[0] < 0.0f) && (Tp[1] < 0.0f) && (Tp[2] < 0.0f)) {
+
157 index = Tp[0] > Tp[1] ? 0 : 1;
+
158 if (Tp[2] > Tp[index]) index = 2;
+
159 }
+
160
+
161 if (index >= 0) {
+
162 shown_disjoint = true;
+
163
+
164 const glm::vec3& qIndex = q[index];
+
165
+
166 glm::vec3 V = qIndex - p[0];
+
167 glm::vec3 Z = glm::cross(Sn, Sv[0]);
+
168 if (glm::dot(V, Z) > 0.0f) {
+
169 V = qIndex - p[1];
+
170 Z = glm::cross(Sn, Sv[1]);
+
171 if (glm::dot(V, Z) > 0.0f) {
+
172 V = qIndex - p[2];
+
173 Z = glm::cross(Sn, Sv[2]);
+
174 if (glm::dot(V, Z) > 0.0f) {
+
175 glm::vec3 cp = qIndex + Sn * Tp[index] / Snl;
+
176 glm::vec3 cq = qIndex;
+
177 return glm::dot(cp - cq, cp - cq);
+
178 }
+
179 }
+
180 }
+
181 }
+
182 }
+
183
+
184 glm::vec3 Tn = glm::cross(Tv[0], Tv[1]);
+
185 float Tnl = glm::dot(Tn, Tn);
+
186
+
187 if (Tnl > 1e-15f) {
+
188 const glm::vec3 Sp(glm::dot(q[0] - p[0], Tn), glm::dot(q[0] - p[1], Tn),
+
189 glm::dot(q[0] - p[2], Tn));
+
190
+
191 int index = -1;
+
192 if ((Sp[0] > 0.0f) && (Sp[1] > 0.0f) && (Sp[2] > 0.0f)) {
+
193 index = Sp[0] < Sp[1] ? 0 : 1;
+
194 if (Sp[2] < Sp[index]) index = 2;
+
195 } else if ((Sp[0] < 0.0f) && (Sp[1] < 0.0f) && (Sp[2] < 0.0f)) {
+
196 index = Sp[0] > Sp[1] ? 0 : 1;
+
197 if (Sp[2] > Sp[index]) index = 2;
+
198 }
+
199
+
200 if (index >= 0) {
+
201 shown_disjoint = true;
+
202
+
203 const glm::vec3& pIndex = p[index];
+
204
+
205 glm::vec3 V = pIndex - q[0];
+
206 glm::vec3 Z = glm::cross(Tn, Tv[0]);
+
207 if (glm::dot(V, Z) > 0.0f) {
+
208 V = pIndex - q[1];
+
209 Z = glm::cross(Tn, Tv[1]);
+
210 if (glm::dot(V, Z) > 0.0f) {
+
211 V = pIndex - q[2];
+
212 Z = glm::cross(Tn, Tv[2]);
+
213 if (glm::dot(V, Z) > 0.0f) {
+
214 glm::vec3 cp = pIndex;
+
215 glm::vec3 cq = pIndex + Tn * Sp[index] / Tnl;
+
216 return glm::dot(cp - cq, cp - cq);
+
217 }
+
218 }
+
219 }
+
220 }
+
221 }
+
222
+
223 return shown_disjoint ? mindd : 0.0f;
+
224};
+
+
225} // namespace manifold
+
Definition vec_view.h:27
+
Definition meshIO.h:20
+
void EdgeEdgeDist(glm::vec3 &x, glm::vec3 &y, const glm::vec3 &p, const glm::vec3 &a, const glm::vec3 &q, const glm::vec3 &b)
Definition tri_dist.h:37
+
float DistanceTriangleTriangleSquared(const std::array< glm::vec3, 3 > &p, const std::array< glm::vec3, 3 > &q)
Definition tri_dist.h:95
+
+
+ + + + diff --git a/docs/html/types_8h_source.html b/docs/html/types_8h_source.html new file mode 100644 index 000000000..7ffade1f7 --- /dev/null +++ b/docs/html/types_8h_source.html @@ -0,0 +1,236 @@ + + + + + + + +Manifold: types.h Source File + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
types.h
+
+
+
1// Copyright 2023 The Manifold Authors.
+
2//
+
3// Licensed under the Apache License, Version 2.0 (the "License");
+
4// you may not use this file except in compliance with the License.
+
5// You may obtain a copy of the License at
+
6//
+
7// http://www.apache.org/licenses/LICENSE-2.0
+
8//
+
9// Unless required by applicable law or agreed to in writing, software
+
10// distributed under the License is distributed on an "AS IS" BASIS,
+
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+
12// See the License for the specific language governing permissions and
+
13// limitations under the License.
+
14
+
15#pragma once
+
16#include <stddef.h>
+
17
+
18// opaque pointers
+
19
+
20typedef struct ManifoldManifold ManifoldManifold;
+
21typedef struct ManifoldManifoldVec ManifoldManifoldVec;
+
22typedef struct ManifoldCrossSection ManifoldCrossSection;
+
23typedef struct ManifoldCrossSectionVec ManifoldCrossSectionVec;
+
24typedef struct ManifoldSimplePolygon ManifoldSimplePolygon;
+
25typedef struct ManifoldPolygons ManifoldPolygons;
+
26typedef struct ManifoldMesh ManifoldMesh;
+
27typedef struct ManifoldMeshGL ManifoldMeshGL;
+
28typedef struct ManifoldBox ManifoldBox;
+
29typedef struct ManifoldRect ManifoldRect;
+
30
+
31#ifdef MANIFOLD_EXPORT
+
32typedef struct ManifoldMaterial ManifoldMaterial;
+
33typedef struct ManifoldExportOptions ManifoldExportOptions;
+
34#endif
+
35
+
36// structs
+
37
+
+
38typedef struct ManifoldManifoldPair {
+
39 ManifoldManifold* first;
+
40 ManifoldManifold* second;
+ +
+
42
+
+
43typedef struct ManifoldVec2 {
+
44 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..11a2b05b3 --- /dev/null +++ b/docs/html/utils_8h_source.html @@ -0,0 +1,369 @@ + + + + + + + +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
+
29#if __has_include(<tracy/Tracy.hpp>)
+
30#include <tracy/Tracy.hpp>
+
31#else
+
32#define FrameMarkStart(x)
+
33#define FrameMarkEnd(x)
+
34// putting ZoneScoped in a function will instrument the function execution when
+
35// TRACY_ENABLE is set, which allows the profiler to record more accurate
+
36// timing.
+
37#define ZoneScoped
+
38#define ZoneScopedN(name)
+
39#endif
+
40
+
41namespace manifold {
+
42
+
47#ifdef MANIFOLD_DEBUG
+
+
48struct Timer {
+
49 std::chrono::high_resolution_clock::time_point start, end;
+
50
+
51 void Start() { start = std::chrono::high_resolution_clock::now(); }
+
52
+
53 void Stop() { end = std::chrono::high_resolution_clock::now(); }
+
54
+
55 float Elapsed() {
+
56 return std::chrono::duration_cast<std::chrono::milliseconds>(end - start)
+
57 .count();
+
58 }
+
59 void Print(std::string message) {
+
60 std::cout << "----------- " << std::round(Elapsed()) << " ms for "
+
61 << message << std::endl;
+
62 }
+
63};
+
+
64#endif
+
65
+
66template <typename... Iters>
+
67thrust::zip_iterator<thrust::tuple<Iters...>> zip(Iters... iters) {
+
68 return thrust::make_zip_iterator(thrust::make_tuple(iters...));
+
69}
+
70
+
71template <typename A, typename B>
+
72thrust::permutation_iterator<A, B> perm(A a, B b) {
+
73 return thrust::make_permutation_iterator(a, b);
+
74}
+
75
+
76template <typename T>
+
77thrust::counting_iterator<T> countAt(T i) {
+
78 return thrust::make_counting_iterator(i);
+
79}
+
80
+
81inline int Next3(int i) {
+
82 constexpr glm::ivec3 next3(1, 2, 0);
+
83 return next3[i];
+
84}
+
85
+
86inline int Prev3(int i) {
+
87 constexpr glm::ivec3 prev3(2, 0, 1);
+
88 return prev3[i];
+
89}
+
90
+
91template <typename T>
+
92T AtomicAdd(T& target, T add) {
+
93 std::atomic<T>& tar = reinterpret_cast<std::atomic<T>&>(target);
+
94 T old_val = tar.load();
+
95 while (!tar.compare_exchange_weak(old_val, old_val + add,
+
96 std::memory_order_seq_cst))
+
97 ;
+
98 return old_val;
+
99}
+
100
+
101template <>
+
102inline int AtomicAdd(int& target, int add) {
+
103 std::atomic<int>& tar = reinterpret_cast<std::atomic<int>&>(target);
+
104 int old_val = tar.fetch_add(add, std::memory_order_seq_cst);
+
105 return old_val;
+
106}
+
107
+
108// Copied from
+
109// https://github.com/thrust/thrust/blob/master/examples/strided_range.cu
+
110template <typename Iterator>
+
+ +
112 public:
+
113 typedef typename thrust::iterator_difference<Iterator>::type difference_type;
+
114
+
+ +
116 : public thrust::unary_function<difference_type, difference_type> {
+
117 difference_type stride;
+
118
+
119 stride_functor(difference_type stride) : stride(stride) {}
+
120
+
121 difference_type operator()(const difference_type& i) const {
+
122 return stride * i;
+
123 }
+
124 };
+
+
125
+
126 typedef typename thrust::counting_iterator<difference_type> CountingIterator;
+
127 typedef typename thrust::transform_iterator<stride_functor, CountingIterator>
+
128 TransformIterator;
+
129 typedef typename thrust::permutation_iterator<Iterator, TransformIterator>
+
130 PermutationIterator;
+
131
+
132 // type of the strided_range iterator
+
133 typedef PermutationIterator iterator;
+
134
+
135 // construct strided_range for the range [first,last)
+
136 strided_range(Iterator first, Iterator last, difference_type stride)
+
137 : first(first), last(last), stride(stride) {}
+
138 strided_range() {}
+
139
+
140 iterator begin(void) const {
+
141 return PermutationIterator(
+
142 first, TransformIterator(CountingIterator(0), stride_functor(stride)));
+
143 }
+
144
+
145 iterator end(void) const {
+
146 return begin() + ((last - first) + (stride - 1)) / stride;
+
147 }
+
148
+
149 protected:
+
150 Iterator first;
+
151 Iterator last;
+
152 difference_type stride;
+
153};
+
+
154
+
155template <typename T>
+
+ +
157 public:
+
158 ConcurrentSharedPtr(T value) : impl(std::make_shared<T>(value)) {}
+ +
160 : impl(other.impl), mutex(other.mutex) {}
+
+ +
162 public:
+
163 SharedPtrGuard(std::recursive_mutex* mutex, T* content)
+
164 : mutex(mutex), content(content) {
+
165 mutex->lock();
+
166 }
+
167 ~SharedPtrGuard() { mutex->unlock(); }
+
168
+
169 T& operator*() { return *content; }
+
170 T* operator->() { return content; }
+
171
+
172 private:
+
173 std::recursive_mutex* mutex;
+
174 T* content;
+
175 };
+
+
176 SharedPtrGuard GetGuard() { return SharedPtrGuard(mutex.get(), impl.get()); };
+
177 unsigned int UseCount() { return impl.use_count(); };
+
178
+
179 private:
+
180 std::shared_ptr<T> impl;
+
181 std::shared_ptr<std::recursive_mutex> mutex =
+
182 std::make_shared<std::recursive_mutex>();
+
183};
+
+
184
+
185template <typename I = int, typename R = unsigned char>
+
+
186struct UnionFind {
+
187 Vec<I> parents;
+
188 // we do union by rank
+
189 // note that we shift rank by 1, rank 0 means it is not connected to anything
+
190 // else
+
191 Vec<R> ranks;
+
192
+
193 UnionFind(I numNodes) : parents(numNodes), ranks(numNodes, 0) {
+
194 sequence(autoPolicy(numNodes), parents.begin(), parents.end());
+
195 }
+
196
+
197 I find(I x) {
+
198 while (parents[x] != x) {
+
199 parents[x] = parents[parents[x]];
+
200 x = parents[x];
+
201 }
+
202 return x;
+
203 }
+
204
+
205 void unionXY(I x, I y) {
+
206 if (x == y) return;
+
207 if (ranks[x] == 0) ranks[x] = 1;
+
208 if (ranks[y] == 0) ranks[y] = 1;
+
209 x = find(x);
+
210 y = find(y);
+
211 if (x == y) return;
+
212 if (ranks[x] < ranks[y]) std::swap(x, y);
+
213 if (ranks[x] == ranks[y]) ranks[x]++;
+
214 parents[y] = x;
+
215 }
+
216
+
217 I connectedComponents(std::vector<I>& components) {
+
218 components.resize(parents.size());
+
219 I lonelyNodes = 0;
+
220 std::unordered_map<I, I> toLabel;
+
221 for (size_t i = 0; i < parents.size(); ++i) {
+
222 // we optimize for connected component of size 1
+
223 // no need to put them into the hashmap
+
224 if (ranks[i] == 0) {
+
225 components[i] = static_cast<I>(toLabel.size()) + lonelyNodes++;
+
226 continue;
+
227 }
+
228 parents[i] = find(i);
+
229 auto iter = toLabel.find(parents[i]);
+
230 if (iter == toLabel.end()) {
+
231 I s = static_cast<I>(toLabel.size()) + lonelyNodes;
+
232 toLabel.insert(std::make_pair(parents[i], s));
+
233 components[i] = s;
+
234 } else {
+
235 components[i] = iter->second;
+
236 }
+
237 }
+
238 return toLabel.size() + lonelyNodes;
+
239 }
+
240};
+
+
242} // namespace manifold
+ +
Definition utils.h:156
+
Definition vec_view.h:27
+
Definition utils.h:111
+
Definition meshIO.h:20
+
Definition utils.h:48
+
Definition utils.h:186
+ +
+
+ + + + diff --git a/docs/html/vec_8h_source.html b/docs/html/vec_8h_source.html new file mode 100644 index 000000000..e8ba20abb --- /dev/null +++ b/docs/html/vec_8h_source.html @@ -0,0 +1,357 @@ + + + + + + + +Manifold: vec.h Source File + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
vec.h
+
+
+
1// Copyright 2021 The Manifold Authors.
+
2//
+
3// Licensed under the Apache License, Version 2.0 (the "License");
+
4// you may not use this file except in compliance with the License.
+
5// You may obtain a copy of the License at
+
6//
+
7// http://www.apache.org/licenses/LICENSE-2.0
+
8//
+
9// Unless required by applicable law or agreed to in writing, software
+
10// distributed under the License is distributed on an "AS IS" BASIS,
+
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+
12// See the License for the specific language governing permissions and
+
13// limitations under the License.
+
14
+
15#pragma once
+
16#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 "par.h"
+
25#include "public.h"
+
26#include "vec_view.h"
+
27
+
28namespace manifold {
+
29
+
33template <typename T>
+
34class Vec;
+
35
+
36/*
+
37 * Specialized vector implementation with multithreaded fill and uninitialized
+
38 * memory optimizations.
+
39 * Note that the constructor and resize function will not perform initialization
+
40 * if the parameter val is not set. Also, this implementation is a toy
+
41 * implementation that did not consider things like non-trivial
+
42 * constructor/destructor, please keep T trivial.
+
43 */
+
44template <typename T>
+
+
45class Vec : public VecView<T> {
+
46 public:
+
47 Vec() {}
+
48
+
49 // Note that the vector constructed with this constructor will contain
+
50 // uninitialized memory. Please specify `val` if you need to make sure that
+
51 // the data is initialized.
+
52 Vec(size_t size) {
+
53 reserve(size);
+
54 this->size_ = size;
+
55 }
+
56
+
57 Vec(size_t size, T val) { resize(size, val); }
+
58
+
59 Vec(const Vec<T> &vec) {
+
60 this->size_ = vec.size();
+
61 this->capacity_ = this->size_;
+
62 auto policy = autoPolicy(this->size_);
+
63 if (this->size_ != 0) {
+
64 this->ptr_ = reinterpret_cast<T *>(malloc(this->size_ * sizeof(T)));
+
65 if (this->ptr_ == nullptr) throw std::bad_alloc();
+
66 TracyAllocS(this->ptr_, this->size_ * sizeof(T), 3);
+
67 uninitialized_copy(policy, vec.begin(), vec.end(), this->ptr_);
+
68 }
+
69 }
+
70
+
71 Vec(const std::vector<T> &vec) {
+
72 this->size_ = vec.size();
+
73 this->capacity_ = this->size_;
+
74 auto policy = autoPolicy(this->size_);
+
75 if (this->size_ != 0) {
+
76 this->ptr_ = reinterpret_cast<T *>(malloc(this->size_ * sizeof(T)));
+
77 if (this->ptr_ == nullptr) throw std::bad_alloc();
+
78 TracyAllocS(this->ptr_, this->size_ * sizeof(T), 3);
+
79 uninitialized_copy(policy, vec.begin(), vec.end(), this->ptr_);
+
80 }
+
81 }
+
82
+
83 Vec(Vec<T> &&vec) {
+
84 this->ptr_ = vec.ptr_;
+
85 this->size_ = vec.size_;
+
86 capacity_ = vec.capacity_;
+
87 vec.ptr_ = nullptr;
+
88 vec.size_ = 0;
+
89 vec.capacity_ = 0;
+
90 }
+
91
+
92 operator VecView<T>() { return {this->ptr_, this->size_}; }
+
93 operator VecView<const T>() const { return {this->ptr_, this->size_}; }
+
94
+
95 ~Vec() {
+
96 if (this->ptr_ != nullptr) {
+
97 TracyFreeS(this->ptr_, 3);
+
98 free(this->ptr_);
+
99 }
+
100 this->ptr_ = nullptr;
+
101 this->size_ = 0;
+
102 capacity_ = 0;
+
103 }
+
104
+
105 Vec<T> &operator=(const Vec<T> &other) {
+
106 if (&other == this) return *this;
+
107 if (this->ptr_ != nullptr) {
+
108 TracyFreeS(this->ptr_, 3);
+
109 free(this->ptr_);
+
110 }
+
111 this->size_ = other.size_;
+
112 capacity_ = other.size_;
+
113 auto policy = autoPolicy(this->size_);
+
114 if (this->size_ != 0) {
+
115 this->ptr_ = reinterpret_cast<T *>(malloc(this->size_ * sizeof(T)));
+
116 if (this->ptr_ == nullptr) throw std::bad_alloc();
+
117 TracyAllocS(this->ptr_, this->size_ * sizeof(T), 3);
+
118 uninitialized_copy(policy, other.begin(), other.end(), this->ptr_);
+
119 }
+
120 return *this;
+
121 }
+
122
+
123 Vec<T> &operator=(Vec<T> &&other) {
+
124 if (&other == this) return *this;
+
125 if (this->ptr_ != nullptr) {
+
126 TracyFreeS(this->ptr_, 3);
+
127 free(this->ptr_);
+
128 }
+
129 this->size_ = other.size_;
+
130 capacity_ = other.capacity_;
+
131 this->ptr_ = other.ptr_;
+
132 other.ptr_ = nullptr;
+
133 other.size_ = 0;
+
134 other.capacity_ = 0;
+
135 return *this;
+
136 }
+
137
+
138 operator VecView<T>() const { return {this->ptr_, this->size_}; }
+
139
+
140 void swap(Vec<T> &other) {
+
141 std::swap(this->ptr_, other.ptr_);
+
142 std::swap(this->size_, other.size_);
+
143 std::swap(capacity_, other.capacity_);
+
144 }
+
145
+
146 inline void push_back(const T &val) {
+
147 if (this->size_ >= capacity_) {
+
148 // avoid dangling pointer in case val is a reference of our array
+
149 T val_copy = val;
+
150 reserve(capacity_ == 0 ? 128 : capacity_ * 2);
+
151 this->ptr_[this->size_++] = val_copy;
+
152 return;
+
153 }
+
154 this->ptr_[this->size_++] = val;
+
155 }
+
156
+
157 void reserve(size_t n) {
+
158 if (n > capacity_) {
+
159 T *newBuffer = reinterpret_cast<T *>(malloc(n * sizeof(T)));
+
160 if (newBuffer == nullptr) throw std::bad_alloc();
+
161 TracyAllocS(newBuffer, n * sizeof(T), 3);
+
162 if (this->size_ > 0)
+
163 uninitialized_copy(autoPolicy(this->size_), this->ptr_,
+
164 this->ptr_ + this->size_, newBuffer);
+
165 if (this->ptr_ != nullptr) {
+
166 TracyFreeS(this->ptr_, 3);
+
167 free(this->ptr_);
+
168 }
+
169 this->ptr_ = newBuffer;
+
170 capacity_ = n;
+
171 }
+
172 }
+
173
+
174 void resize(size_t newSize, T val = T()) {
+
175 bool shrink = this->size_ > 2 * newSize;
+
176 reserve(newSize);
+
177 if (this->size_ < newSize) {
+
178 uninitialized_fill(autoPolicy(newSize - this->size_),
+
179 this->ptr_ + this->size_, this->ptr_ + newSize, val);
+
180 }
+
181 this->size_ = newSize;
+
182 if (shrink) shrink_to_fit();
+
183 }
+
184
+
185 void shrink_to_fit() {
+
186 T *newBuffer = nullptr;
+
187 if (this->size_ > 0) {
+
188 newBuffer = reinterpret_cast<T *>(malloc(this->size_ * sizeof(T)));
+
189 if (newBuffer == nullptr) throw std::bad_alloc();
+
190 TracyAllocS(newBuffer, this->size_ * sizeof(T), 3);
+
191 uninitialized_copy(autoPolicy(this->size_), this->ptr_,
+
192 this->ptr_ + this->size_, newBuffer);
+
193 }
+
194 if (this->ptr_ != nullptr) {
+
195 TracyFreeS(this->ptr_, 3);
+
196 free(this->ptr_);
+
197 }
+
198 this->ptr_ = newBuffer;
+
199 capacity_ = this->size_;
+
200 }
+
201
+
202 VecView<T> view(size_t offset = 0,
+
203 size_t length = std::numeric_limits<size_t>::max()) {
+
204 if (length == std::numeric_limits<size_t>::max()) {
+
205 length = this->size_ - offset;
+
206 if (length < 0) throw std::out_of_range("Vec::view out of range");
+
207 } else if (offset + length > this->size_ || offset < 0) {
+
208 throw std::out_of_range("Vec::view out of range");
+
209 } else if (length < 0) {
+
210 throw std::out_of_range("Vec::view negative length is not allowed");
+
211 }
+
212 return VecView<T>(this->ptr_ + offset, length);
+
213 }
+
214
+
215 VecView<const T> cview(
+
216 size_t offset = 0,
+
217 size_t length = std::numeric_limits<size_t>::max()) const {
+
218 if (length == std::numeric_limits<size_t>::max()) {
+
219 length = this->size_ - offset;
+
220 if (length < 0) throw std::out_of_range("Vec::cview out of range");
+
221 } else if (offset + length > this->size_ || offset < 0) {
+
222 throw std::out_of_range("Vec::cview out of range");
+
223 } else if (length < 0) {
+
224 throw std::out_of_range("Vec::cview negative length is not allowed");
+
225 }
+
226 return VecView<const T>(this->ptr_ + offset, length);
+
227 }
+
228
+
229 VecView<const T> view(
+
230 size_t offset = 0,
+
231 size_t length = std::numeric_limits<size_t>::max()) const {
+
232 return cview(offset, length);
+
233 }
+
234
+
235 T *data() { return this->ptr_; }
+
236 const T *data() const { return this->ptr_; }
+
237
+
238 private:
+
239 size_t capacity_ = 0;
+
240
+
241 static_assert(std::is_trivially_destructible<T>::value);
+
242};
+
+
244} // namespace manifold
+
Definition vec.h:45
+
Definition vec_view.h:27
+
Definition meshIO.h:20
+
+
+ + + + diff --git a/docs/html/vec__view_8h_source.html b/docs/html/vec__view_8h_source.html new file mode 100644 index 000000000..1e88e8e9f --- /dev/null +++ b/docs/html/vec__view_8h_source.html @@ -0,0 +1,227 @@ + + + + + + + +Manifold: vec_view.h Source File + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
Manifold 1.0 +
+
Robust computational geometry
+
+ +   + + + + +
+
+
+ + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
vec_view.h
+
+
+
1// Copyright 2023 The Manifold Authors.
+
2//
+
3// Licensed under the Apache License, Version 2.0 (the "License");
+
4// you may not use this file except in compliance with the License.
+
5// You may obtain a copy of the License at
+
6//
+
7// http://www.apache.org/licenses/LICENSE-2.0
+
8//
+
9// Unless required by applicable law or agreed to in writing, software
+
10// distributed under the License is distributed on an "AS IS" BASIS,
+
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+
12// See the License for the specific language governing permissions and
+
13// limitations under the License.
+
14
+
15#pragma once
+
16
+
17#include <stdexcept>
+
18
+
19namespace manifold {
+
20
+
26template <typename T>
+
+
27class VecView {
+
28 public:
+
29 using Iter = T *;
+
30 using IterC = const T *;
+
31
+
32 VecView(T *ptr_, size_t size_) : ptr_(ptr_), size_(size_) {}
+
33
+
34 VecView(const VecView &other) {
+
35 ptr_ = other.ptr_;
+
36 size_ = other.size_;
+
37 }
+
38
+
39 VecView &operator=(const VecView &other) {
+
40 ptr_ = other.ptr_;
+
41 size_ = other.size_;
+
42 return *this;
+
43 }
+
44
+
45 // allows conversion to a const VecView
+
46 operator VecView<const T>() const { return {ptr_, size_}; }
+
47
+
48 inline const T &operator[](size_t i) const {
+
49 if (i >= size_) {
+
50 throw std::out_of_range("Vec out of range");
+
51 }
+
52 return ptr_[i];
+
53 }
+
54
+
55 inline T &operator[](size_t i) {
+
56 if (i >= size_) {
+
57 throw std::out_of_range("Vec out of range");
+
58 }
+
59 return ptr_[i];
+
60 }
+
61
+
62 IterC cbegin() const { return ptr_; }
+
63 IterC cend() const { return ptr_ + size_; }
+
64
+
65 IterC begin() const { return cbegin(); }
+
66 IterC end() const { return cend(); }
+
67
+
68 Iter begin() { return ptr_; }
+
69 Iter end() { return ptr_ + size_; }
+
70
+
71 const T &front() const {
+
72 if (size_ == 0)
+
73 throw std::out_of_range("attempt to take the front of an empty vector");
+
74 return ptr_[0];
+
75 }
+
76
+
77 const T &back() const {
+
78 if (size_ == 0)
+
79 throw std::out_of_range("attempt to take the back of an empty vector");
+
80 return ptr_[size_ - 1];
+
81 }
+
82
+
83 T &front() {
+
84 if (size_ == 0)
+
85 throw std::out_of_range("attempt to take the front of an empty vector");
+
86 return ptr_[0];
+
87 }
+
88
+
89 T &back() {
+
90 if (size_ == 0)
+
91 throw std::out_of_range("attempt to take the back of an empty vector");
+
92 return ptr_[size_ - 1];
+
93 }
+
94
+
95 size_t size() const { return size_; }
+
96
+
97 bool empty() const { return size_ == 0; }
+
98
+
99#ifdef MANIFOLD_DEBUG
+
100 void Dump() const {
+
101 std::cout << "Vec = " << std::endl;
+
102 for (size_t i = 0; i < size(); ++i) {
+
103 std::cout << i << ", " << ptr_[i] << ", " << std::endl;
+
104 }
+
105 std::cout << std::endl;
+
106 }
+
107#endif
+
108
+
109 protected:
+
110 T *ptr_ = nullptr;
+
111 size_t size_ = 0;
+
112
+
113 VecView() = default;
+
114};
+
+
115
+
116} // namespace manifold
+
Definition vec_view.h:27
+
Definition meshIO.h:20
+
+
+ + + + diff --git a/editor.d.ts b/editor.d.ts new file mode 100644 index 000000000..bfc464b22 --- /dev/null +++ b/editor.d.ts @@ -0,0 +1,3290 @@ +// Copyright 2023 The Manifold Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import {Manifold, Mat4, Vec2, Vec3} from './manifold'; + +declare class GLTFNode { + manifold?: Manifold; + translation?: Vec3|((t: number) => Vec3); + rotation?: Vec3|((t: number) => Vec3); + scale?: Vec3|((t: number) => Vec3); + material?: GLTFMaterial; + name?: string; + constructor(parent?: GLTFNode); + clone(parent?: GLTFNode): GLTFNode; +} + +type Attribute = 'POSITION'|'NORMAL'|'TANGENT'|'TEXCOORD_0'|'TEXCOORD_1'| + 'COLOR_0'|'JOINTS_0'|'WEIGHTS_0'|'SKIP_1'|'SKIP_2'|'SKIP_3'|'SKIP_4'; + +declare class GLTFMaterial { + attributes?: Attribute[]; + roughness?: number; + metallic?: number; + baseColorFactor?: [number, number, number]; + alpha?: number; + unlit?: boolean; + name?: string; +} + +declare const globalDefaults: { + roughness: number, + metallic: number, + baseColorFactor: [number, number, number], + alpha: number, + unlit: boolean, + animationLength: number, + animationMode: 'loop'|'ping-pong'; +} + +/** + * Returns a shallow copy of the input manifold with the given material + * properties applied. They will be carried along through operations. + * + * @param manifold The input object. + * @param material A set of material properties to apply to this manifold. + */ +declare function setMaterial(manifold: Manifold, material: GLTFMaterial): + Manifold; + +/** + * Apply a morphing animation to the input manifold. Specify the start + * function which will be applied to the vertex positions of the first frame and + * linearly interpolated across the length of the overall animation. This + * animation will only be shown if this manifold is used directly on a GLTFNode. + * + * @param manifold The object to add morphing animation to. + * @param func A warping function to apply to the first animation frame. + */ +declare function setMorphStart( + manifold: Manifold, func: (v: Vec3) => void): void; + +/** + * Apply a morphing animation to the input manifold. Specify the end + * function which will be applied to the vertex positions of the last frame and + * linearly interpolated across the length of the overall animation. This + * animation will only be shown if this manifold is used directly on a GLTFNode. + * + * @param manifold The object to add morphing animation to. + * @param func A warping function to apply to the last animation frame. + */ +declare function setMorphEnd(manifold: Manifold, func: (v: Vec3) => void): void; + +/** + * Wrap any shape object with this method to display it and any copies in + * transparent red. This is particularly useful for debugging subtract() as it + * will allow you find the object even if it doesn't currently intersect the + * result. + * + * @param shape The object to show - returned for chaining. + */ +declare function show(shape: CrossSection|Manifold): Manifold; + +/** + * Wrap any shape object with this method to display it and any copies as the + * result, while ghosting out the final result in transparent gray. Helpful for + * debugging as it allows you to see objects that may be hidden in the interior + * of the result. Multiple objects marked only() will all be shown. + * + * @param shape The object to show - returned for chaining. + */ +declare function only(shape: CrossSection|Manifold): Manifold; + +// Type definitions for gl-matrix 3.4.3 Project: +// https://github.com/toji/gl-matrix +// +// Definitions by: Mattijs Kneppers , +// +// based on definitions by Tat +// +// Definitions by: Nikolay Babanov + +declare const glMatrix: GLMatrix; + +interface GLMatrix { + glMatrix: TopAPI; + vec2: Vec2API; + vec3: Vec3API; + vec4: Vec4API; + mat2: Mat2API; + mat2d: Mat2dAPI; + mat3: Mat3API; + mat4: Mat4API; + quat: QuatAPI; +} + +interface TopAPI { + // Configuration constants + EPSILON: number; + ARRAY_TYPE: any; + RANDOM(): number; + ENABLE_SIMD: boolean; + + // Compatibility detection + SIMD_AVAILABLE: boolean; + USE_SIMD: boolean; + + /** + * Sets the type of array used when creating new vectors and matrices + * + * @param {any} type - Array type, such as Float32Array or Array + */ + setMatrixArrayType(type: any): void; + + /** + * Convert Degree To Radian + * + * @param {number} a - Angle in Degrees + */ + toRadian(a: number): number; + + /** + * Tests whether or not the arguments have approximately the same value, + * within an absolute or relative tolerance of glMatrix.EPSILON (an absolute + * tolerance is used for values less than or equal to 1.0, and a relative + * tolerance is used for larger values) + * + * @param {number} a - The first number to test. + * @param {number} b - The second number to test. + * @returns {boolean} True if the numbers are approximately equal, false + * otherwise. + */ + equals(a: number, b: number): boolean; +} + +type Vec4 = [number, number, number, number]; +type Mat2 = [ + number, + number, + number, + number, +]; +type Mat2d = [ + number, + number, + number, + number, + number, + number, +]; +type Mat3 = [ + number, + number, + number, + number, + number, + number, + number, + number, + number, +]; +type Quat = [number, number, number, number]; + +interface Vec2API { + /** + * Creates a new, empty Vec2 + * + * @returns a new 2D vector + */ + create(): Vec2; + + /** + * Creates a new Vec2 initialized with values from an existing vector + * + * @param a a vector to clone + * @returns a new 2D vector + */ + clone(a: Vec2): Vec2; + + /** + * Creates a new Vec2 initialized with the given values + * + * @param x X component + * @param y Y component + * @returns a new 2D vector + */ + fromValues(x: number, y: number): Vec2; + + /** + * Copy the values from one Vec2 to another + * + * @param out the receiving vector + * @param a the source vector + * @returns out + */ + copy(out: Vec2, a: Vec2): Vec2; + + /** + * Set the components of a Vec2 to the given values + * + * @param out the receiving vector + * @param x X component + * @param y Y component + * @returns out + */ + set(out: Vec2, x: number, y: number): Vec2; + + /** + * Adds two Vec2's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + add(out: Vec2, a: Vec2, b: Vec2): Vec2; + + /** + * Subtracts vector b from vector a + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + subtract(out: Vec2, a: Vec2, b: Vec2): Vec2; + + /** + * Subtracts vector b from vector a + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + sub(out: Vec2, a: Vec2, b: Vec2): Vec2; + + /** + * Multiplies two Vec2's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + multiply(out: Vec2, a: Vec2, b: Vec2): Vec2; + + /** + * Multiplies two Vec2's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + mul(out: Vec2, a: Vec2, b: Vec2): Vec2; + + /** + * Divides two Vec2's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + divide(out: Vec2, a: Vec2, b: Vec2): Vec2; + + /** + * Divides two Vec2's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + div(out: Vec2, a: Vec2, b: Vec2): Vec2; + + /** + * Math.ceil the components of a Vec2 + * + * @param {Vec2} out the receiving vector + * @param {Vec2} a vector to ceil + * @returns {Vec2} out + */ + ceil(out: Vec2, a: Vec2): Vec2; + + /** + * Math.floor the components of a Vec2 + * + * @param {Vec2} out the receiving vector + * @param {Vec2} a vector to floor + * @returns {Vec2} out + */ + floor(out: Vec2, a: Vec2): Vec2; + + /** + * Returns the minimum of two Vec2's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + min(out: Vec2, a: Vec2, b: Vec2): Vec2; + + /** + * Returns the maximum of two Vec2's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + max(out: Vec2, a: Vec2, b: Vec2): Vec2; + + /** + * Rotates the 2D vector. + * + * @param {Vec2} out the receiving vector + * @param {Vec2} a vector to rotate + * @param {Vec2} b origin of the rotation + * @param {number} rad angle of rotation in radians + * @returns {Vec2} out + */ + rotate(out: Vec2, a: Vec2, b: Vec2, rad: number): Vec2; + + /** + * Math.round the components of a Vec2 + * + * @param {Vec2} out the receiving vector + * @param {Vec2} a vector to round + * @returns {Vec2} out + */ + round(out: Vec2, a: Vec2): Vec2; + + /** + * Scales a Vec2 by a scalar number + * + * @param out the receiving vector + * @param a the vector to scale + * @param b amount to scale the vector by + * @returns out + */ + scale(out: Vec2, a: Vec2, b: number): Vec2; + + /** + * Adds two Vec2's after scaling the second operand by a scalar value + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @param scale the amount to scale b by before adding + * @returns out + */ + scaleAndAdd(out: Vec2, a: Vec2, b: Vec2, scale: number): Vec2; + + /** + * Calculates the euclidian distance between two Vec2's + * + * @param a the first operand + * @param b the second operand + * @returns distance between a and b + */ + distance(a: Vec2, b: Vec2): number; + + /** + * Calculates the euclidian distance between two Vec2's + * + * @param a the first operand + * @param b the second operand + * @returns distance between a and b + */ + dist(a: Vec2, b: Vec2): number; + + /** + * Calculates the squared euclidian distance between two Vec2's + * + * @param a the first operand + * @param b the second operand + * @returns squared distance between a and b + */ + squaredDistance(a: Vec2, b: Vec2): number; + + /** + * Calculates the squared euclidian distance between two Vec2's + * + * @param a the first operand + * @param b the second operand + * @returns squared distance between a and b + */ + sqrDist(a: Vec2, b: Vec2): number; + + /** + * Calculates the length of a Vec2 + * + * @param a vector to calculate length of + * @returns length of a + */ + length(a: Vec2): number; + + /** + * Calculates the length of a Vec2 + * + * @param a vector to calculate length of + * @returns length of a + */ + len(a: Vec2): number; + + /** + * Calculates the squared length of a Vec2 + * + * @param a vector to calculate squared length of + * @returns squared length of a + */ + squaredLength(a: Vec2): number; + + /** + * Calculates the squared length of a Vec2 + * + * @param a vector to calculate squared length of + * @returns squared length of a + */ + sqrLen(a: Vec2): number; + + /** + * Negates the components of a Vec2 + * + * @param out the receiving vector + * @param a vector to negate + * @returns out + */ + negate(out: Vec2, a: Vec2): Vec2; + + /** + * Returns the inverse of the components of a Vec2 + * + * @param out the receiving vector + * @param a vector to invert + * @returns out + */ + inverse(out: Vec2, a: Vec2): Vec2; + + /** + * Normalize a Vec2 + * + * @param out the receiving vector + * @param a vector to normalize + * @returns out + */ + normalize(out: Vec2, a: Vec2): Vec2; + + /** + * Calculates the dot product of two Vec2's + * + * @param a the first operand + * @param b the second operand + * @returns dot product of a and b + */ + dot(a: Vec2, b: Vec2): number; + + /** + * Computes the cross product of two Vec2's + * Note that the cross product must by definition produce a 3D vector + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + cross(out: Vec2, a: Vec2, b: Vec2): Vec2; + + /** + * Performs a linear interpolation between two Vec2's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @param t interpolation amount between the two inputs + * @returns out + */ + lerp(out: Vec2, a: Vec2, b: Vec2, t: number): Vec2; + + /** + * Generates a random unit vector + * + * @param out the receiving vector + * @returns out + */ + random(out: Vec2): Vec2; + + /** + * Generates a random vector with the given scale + * + * @param out the receiving vector + * @param scale Length of the resulting vector. If ommitted, a unit vector + * will be returned + * @returns out + */ + random(out: Vec2, scale: number): Vec2; + + /** + * Transforms the Vec2 with a Mat2 + * + * @param out the receiving vector + * @param a the vector to transform + * @param m matrix to transform with + * @returns out + */ + transformMat2(out: Vec2, a: Vec2, m: Mat2): Vec2; + + /** + * Transforms the Vec2 with a Mat2d + * + * @param out the receiving vector + * @param a the vector to transform + * @param m matrix to transform with + * @returns out + */ + transformMat2d(out: Vec2, a: Vec2, m: Mat2d): Vec2; + + /** + * Transforms the Vec2 with a Mat3 + * 3rd vector component is implicitly '1' + * + * @param out the receiving vector + * @param a the vector to transform + * @param m matrix to transform with + * @returns out + */ + transformMat3(out: Vec2, a: Vec2, m: Mat3): Vec2; + + /** + * Transforms the Vec2 with a Mat4 + * 3rd vector component is implicitly '0' + * 4th vector component is implicitly '1' + * + * @param out the receiving vector + * @param a the vector to transform + * @param m matrix to transform with + * @returns out + */ + transformMat4(out: Vec2, a: Vec2, m: Mat4): Vec2; + + /** + * Perform some operation over an array of vec2Types. + * + * @param a the array of vectors to iterate over + * @param stride Number of elements between the start of each Vec2. If 0 + * assumes tightly packed + * @param offset Number of elements to skip at the beginning of the array + * @param count Number of vec2Types to iterate over. If 0 iterates over entire + * array + * @param fn Function to call for each vector in the array + * @param arg additional argument to pass to fn + * @returns a + */ + forEach( + a: Float32Array, stride: number, offset: number, count: number, + fn: (a: Vec2, b: Vec2, arg: any) => void, arg: any): Float32Array; + + /** + * Perform some operation over an array of vec2Types. + * + * @param a the array of vectors to iterate over + * @param stride Number of elements between the start of each Vec2. If 0 + * assumes tightly packed + * @param offset Number of elements to skip at the beginning of the array + * @param count Number of vec2Types to iterate over. If 0 iterates over entire + * array + * @param fn Function to call for each vector in the array + * @returns a + */ + forEach( + a: Float32Array, stride: number, offset: number, count: number, + fn: (a: Vec2, b: Vec2) => void): Float32Array; + + /** + * Returns a string representation of a vector + * + * @param a vector to represent as a string + * @returns string representation of the vector + */ + str(a: Vec2): string; + + /** + * Returns whether or not the vectors exactly have the same elements in the + * same position (when compared with ===) + * + * @param {Vec2} a The first vector. + * @param {Vec2} b The second vector. + * @returns {boolean} True if the vectors are equal, false otherwise. + */ + exactEquals(a: Vec2, b: Vec2): boolean; + + /** + * Returns whether or not the vectors have approximately the same elements + * in the same position. + * + * @param {Vec2} a The first vector. + * @param {Vec2} b The second vector. + * @returns {boolean} True if the vectors are equal, false otherwise. + */ + equals(a: Vec2, b: Vec2): boolean; +} + +// Vec3 +interface Vec3API { + /** + * Creates a new, empty Vec3 + * + * @returns a new 3D vector + */ + create(): Vec3; + + /** + * Creates a new Vec3 initialized with values from an existing vector + * + * @param a vector to clone + * @returns a new 3D vector + */ + clone(a: Vec3): Vec3; + + /** + * Creates a new Vec3 initialized with the given values + * + * @param x X component + * @param y Y component + * @param z Z component + * @returns a new 3D vector + */ + fromValues(x: number, y: number, z: number): Vec3; + + /** + * Copy the values from one Vec3 to another + * + * @param out the receiving vector + * @param a the source vector + * @returns out + */ + copy(out: Vec3, a: Vec3): Vec3; + + /** + * Set the components of a Vec3 to the given values + * + * @param out the receiving vector + * @param x X component + * @param y Y component + * @param z Z component + * @returns out + */ + set(out: Vec3, x: number, y: number, z: number): Vec3; + + /** + * Adds two Vec3's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + add(out: Vec3, a: Vec3, b: Vec3): Vec3; + + /** + * Subtracts vector b from vector a + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + subtract(out: Vec3, a: Vec3, b: Vec3): Vec3; + + /** + * Subtracts vector b from vector a + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + sub(out: Vec3, a: Vec3, b: Vec3): Vec3 + + /** + * Multiplies two Vec3's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + multiply(out: Vec3, a: Vec3, b: Vec3): Vec3; + + /** + * Multiplies two Vec3's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + mul(out: Vec3, a: Vec3, b: Vec3): Vec3; + + /** + * Divides two Vec3's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + divide(out: Vec3, a: Vec3, b: Vec3): Vec3; + + /** + * Divides two Vec3's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + div(out: Vec3, a: Vec3, b: Vec3): Vec3; + + /** + * Math.ceil the components of a Vec3 + * + * @param {Vec3} out the receiving vector + * @param {Vec3} a vector to ceil + * @returns {Vec3} out + */ + ceil(out: Vec3, a: Vec3): Vec3; + + /** + * Math.floor the components of a Vec3 + * + * @param {Vec3} out the receiving vector + * @param {Vec3} a vector to floor + * @returns {Vec3} out + */ + floor(out: Vec3, a: Vec3): Vec3; + + /** + * Returns the minimum of two Vec3's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + min(out: Vec3, a: Vec3, b: Vec3): Vec3; + + /** + * Returns the maximum of two Vec3's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + max(out: Vec3, a: Vec3, b: Vec3): Vec3; + + /** + * Math.round the components of a Vec3 + * + * @param {Vec3} out the receiving vector + * @param {Vec3} a vector to round + * @returns {Vec3} out + */ + round(out: Vec3, a: Vec3): Vec3 + + /** + * Scales a Vec3 by a scalar number + * + * @param out the receiving vector + * @param a the vector to scale + * @param b amount to scale the vector by + * @returns out + */ + scale(out: Vec3, a: Vec3, b: number): Vec3; + + /** + * Adds two Vec3's after scaling the second operand by a scalar value + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @param scale the amount to scale b by before adding + * @returns out + */ + scaleAndAdd(out: Vec3, a: Vec3, b: Vec3, scale: number): Vec3; + + /** + * Calculates the euclidian distance between two Vec3's + * + * @param a the first operand + * @param b the second operand + * @returns distance between a and b + */ + distance(a: Vec3, b: Vec3): number; + + /** + * Calculates the euclidian distance between two Vec3's + * + * @param a the first operand + * @param b the second operand + * @returns distance between a and b + */ + dist(a: Vec3, b: Vec3): number; + + /** + * Calculates the squared euclidian distance between two Vec3's + * + * @param a the first operand + * @param b the second operand + * @returns squared distance between a and b + */ + squaredDistance(a: Vec3, b: Vec3): number; + + /** + * Calculates the squared euclidian distance between two Vec3's + * + * @param a the first operand + * @param b the second operand + * @returns squared distance between a and b + */ + sqrDist(a: Vec3, b: Vec3): number; + + /** + * Calculates the length of a Vec3 + * + * @param a vector to calculate length of + * @returns length of a + */ + length(a: Vec3): number; + + /** + * Calculates the length of a Vec3 + * + * @param a vector to calculate length of + * @returns length of a + */ + len(a: Vec3): number; + + /** + * Calculates the squared length of a Vec3 + * + * @param a vector to calculate squared length of + * @returns squared length of a + */ + squaredLength(a: Vec3): number; + + /** + * Calculates the squared length of a Vec3 + * + * @param a vector to calculate squared length of + * @returns squared length of a + */ + sqrLen(a: Vec3): number; + + /** + * Negates the components of a Vec3 + * + * @param out the receiving vector + * @param a vector to negate + * @returns out + */ + negate(out: Vec3, a: Vec3): Vec3; + + /** + * Returns the inverse of the components of a Vec3 + * + * @param out the receiving vector + * @param a vector to invert + * @returns out + */ + inverse(out: Vec3, a: Vec3): Vec3; + + /** + * Normalize a Vec3 + * + * @param out the receiving vector + * @param a vector to normalize + * @returns out + */ + normalize(out: Vec3, a: Vec3): Vec3; + + /** + * Calculates the dot product of two Vec3's + * + * @param a the first operand + * @param b the second operand + * @returns dot product of a and b + */ + dot(a: Vec3, b: Vec3): number; + + /** + * Computes the cross product of two Vec3's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + cross(out: Vec3, a: Vec3, b: Vec3): Vec3; + + /** + * Performs a linear interpolation between two Vec3's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @param t interpolation amount between the two inputs + * @returns out + */ + lerp(out: Vec3, a: Vec3, b: Vec3, t: number): Vec3; + + /** + * Performs a hermite interpolation with two control points + * + * @param {Vec3} out the receiving vector + * @param {Vec3} a the first operand + * @param {Vec3} b the second operand + * @param {Vec3} c the third operand + * @param {Vec3} d the fourth operand + * @param {number} t interpolation amount between the two inputs + * @returns {Vec3} out + */ + hermite(out: Vec3, a: Vec3, b: Vec3, c: Vec3, d: Vec3, t: number): Vec3; + + /** + * Performs a bezier interpolation with two control points + * + * @param {Vec3} out the receiving vector + * @param {Vec3} a the first operand + * @param {Vec3} b the second operand + * @param {Vec3} c the third operand + * @param {Vec3} d the fourth operand + * @param {number} t interpolation amount between the two inputs + * @returns {Vec3} out + */ + bezier(out: Vec3, a: Vec3, b: Vec3, c: Vec3, d: Vec3, t: number): Vec3; + + /** + * Generates a random unit vector + * + * @param out the receiving vector + * @returns out + */ + random(out: Vec3): Vec3; + + /** + * Generates a random vector with the given scale + * + * @param out the receiving vector + * @param [scale] Length of the resulting vector. If omitted, a unit vector + * will be returned + * @returns out + */ + random(out: Vec3, scale: number): Vec3; + + /** + * Transforms the Vec3 with a Mat3. + * + * @param out the receiving vector + * @param a the vector to transform + * @param m the 3x3 matrix to transform with + * @returns out + */ + transformMat3(out: Vec3, a: Vec3, m: Mat3): Vec3; + + /** + * Transforms the Vec3 with a Mat4. + * 4th vector component is implicitly '1' + * + * @param out the receiving vector + * @param a the vector to transform + * @param m matrix to transform with + * @returns out + */ + transformMat4(out: Vec3, a: Vec3, m: Mat4): Vec3; + + /** + * Transforms the Vec3 with a Quat + * + * @param out the receiving vector + * @param a the vector to transform + * @param q Quaternion to transform with + * @returns out + */ + transformQuat(out: Vec3, a: Vec3, q: Quat): Vec3; + + + /** + * Rotate a 3D vector around the x-axis + * @param out The receiving Vec3 + * @param a The Vec3 point to rotate + * @param b The origin of the rotation + * @param c The angle of rotation + * @returns out + */ + rotateX(out: Vec3, a: Vec3, b: Vec3, c: number): Vec3; + + /** + * Rotate a 3D vector around the y-axis + * @param out The receiving Vec3 + * @param a The Vec3 point to rotate + * @param b The origin of the rotation + * @param c The angle of rotation + * @returns out + */ + rotateY(out: Vec3, a: Vec3, b: Vec3, c: number): Vec3; + + /** + * Rotate a 3D vector around the z-axis + * @param out The receiving Vec3 + * @param a The Vec3 point to rotate + * @param b The origin of the rotation + * @param c The angle of rotation + * @returns out + */ + rotateZ(out: Vec3, a: Vec3, b: Vec3, c: number): Vec3; + + /** + * Perform some operation over an array of vec3s. + * + * @param a the array of vectors to iterate over + * @param stride Number of elements between the start of each Vec3. If 0 + * assumes tightly packed + * @param offset Number of elements to skip at the beginning of the array + * @param count Number of vec3s to iterate over. If 0 iterates over entire + * array + * @param fn Function to call for each vector in the array + * @param arg additional argument to pass to fn + * @returns a + * @function + */ + forEach( + a: Float32Array, stride: number, offset: number, count: number, + fn: (a: Vec3, b: Vec3, arg: any) => void, arg: any): Float32Array; + + /** + * Perform some operation over an array of vec3s. + * + * @param a the array of vectors to iterate over + * @param stride Number of elements between the start of each Vec3. If 0 + * assumes tightly packed + * @param offset Number of elements to skip at the beginning of the array + * @param count Number of vec3s to iterate over. If 0 iterates over entire + * array + * @param fn Function to call for each vector in the array + * @returns a + * @function + */ + forEach( + a: Float32Array, stride: number, offset: number, count: number, + fn: (a: Vec3, b: Vec3) => void): Float32Array; + + /** + * Get the angle between two 3D vectors + * @param a The first operand + * @param b The second operand + * @returns The angle in radians + */ + angle(a: Vec3, b: Vec3): number; + + /** + * Returns a string representation of a vector + * + * @param a vector to represent as a string + * @returns string representation of the vector + */ + str(a: Vec3): string; + + /** + * Returns whether or not the vectors have exactly the same elements in the + * same position (when compared with ===) + * + * @param {Vec3} a The first vector. + * @param {Vec3} b The second vector. + * @returns {boolean} True if the vectors are equal, false otherwise. + */ + exactEquals(a: Vec3, b: Vec3): boolean + + /** + * Returns whether or not the vectors have approximately the same + * elements in the same position. + * + * @param {Vec3} a The first vector. + * @param {Vec3} b The second vector. + * @returns {boolean} True if the vectors are equal, false otherwise. + */ + equals(a: Vec3, b: Vec3): boolean +} + +// Vec4 +interface Vec4API { + /** + * Creates a new, empty Vec4 + * + * @returns a new 4D vector + */ + create(): Vec4; + + /** + * Creates a new Vec4 initialized with values from an existing vector + * + * @param a vector to clone + * @returns a new 4D vector + */ + clone(a: Vec4): Vec4; + + /** + * Creates a new Vec4 initialized with the given values + * + * @param x X component + * @param y Y component + * @param z Z component + * @param w W component + * @returns a new 4D vector + */ + fromValues(x: number, y: number, z: number, w: number): Vec4; + + /** + * Copy the values from one Vec4 to another + * + * @param out the receiving vector + * @param a the source vector + * @returns out + */ + copy(out: Vec4, a: Vec4): Vec4; + + /** + * Set the components of a Vec4 to the given values + * + * @param out the receiving vector + * @param x X component + * @param y Y component + * @param z Z component + * @param w W component + * @returns out + */ + set(out: Vec4, x: number, y: number, z: number, w: number): Vec4; + + /** + * Adds two Vec4's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + add(out: Vec4, a: Vec4, b: Vec4): Vec4; + + /** + * Subtracts vector b from vector a + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + subtract(out: Vec4, a: Vec4, b: Vec4): Vec4; + + /** + * Subtracts vector b from vector a + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + sub(out: Vec4, a: Vec4, b: Vec4): Vec4; + + /** + * Multiplies two Vec4's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + multiply(out: Vec4, a: Vec4, b: Vec4): Vec4; + + /** + * Multiplies two Vec4's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + mul(out: Vec4, a: Vec4, b: Vec4): Vec4; + + /** + * Divides two Vec4's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + divide(out: Vec4, a: Vec4, b: Vec4): Vec4; + + /** + * Divides two Vec4's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + div(out: Vec4, a: Vec4, b: Vec4): Vec4; + + /** + * Math.ceil the components of a Vec4 + * + * @param {Vec4} out the receiving vector + * @param {Vec4} a vector to ceil + * @returns {Vec4} out + */ + ceil(out: Vec4, a: Vec4): Vec4; + + /** + * Math.floor the components of a Vec4 + * + * @param {Vec4} out the receiving vector + * @param {Vec4} a vector to floor + * @returns {Vec4} out + */ + floor(out: Vec4, a: Vec4): Vec4; + + /** + * Returns the minimum of two Vec4's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + min(out: Vec4, a: Vec4, b: Vec4): Vec4; + + /** + * Returns the maximum of two Vec4's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @returns out + */ + max(out: Vec4, a: Vec4, b: Vec4): Vec4; + + /** + * Math.round the components of a Vec4 + * + * @param {Vec4} out the receiving vector + * @param {Vec4} a vector to round + * @returns {Vec4} out + */ + round(out: Vec4, a: Vec4): Vec4; + + /** + * Scales a Vec4 by a scalar number + * + * @param out the receiving vector + * @param a the vector to scale + * @param b amount to scale the vector by + * @returns out + */ + scale(out: Vec4, a: Vec4, b: number): Vec4; + + /** + * Adds two Vec4's after scaling the second operand by a scalar value + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @param scale the amount to scale b by before adding + * @returns out + */ + scaleAndAdd(out: Vec4, a: Vec4, b: Vec4, scale: number): Vec4; + + /** + * Calculates the euclidian distance between two Vec4's + * + * @param a the first operand + * @param b the second operand + * @returns distance between a and b + */ + distance(a: Vec4, b: Vec4): number; + + /** + * Calculates the euclidian distance between two Vec4's + * + * @param a the first operand + * @param b the second operand + * @returns distance between a and b + */ + dist(a: Vec4, b: Vec4): number; + + /** + * Calculates the squared euclidian distance between two Vec4's + * + * @param a the first operand + * @param b the second operand + * @returns squared distance between a and b + */ + squaredDistance(a: Vec4, b: Vec4): number; + + /** + * Calculates the squared euclidian distance between two Vec4's + * + * @param a the first operand + * @param b the second operand + * @returns squared distance between a and b + */ + sqrDist(a: Vec4, b: Vec4): number; + + /** + * Calculates the length of a Vec4 + * + * @param a vector to calculate length of + * @returns length of a + */ + length(a: Vec4): number; + + /** + * Calculates the length of a Vec4 + * + * @param a vector to calculate length of + * @returns length of a + */ + len(a: Vec4): number; + + /** + * Calculates the squared length of a Vec4 + * + * @param a vector to calculate squared length of + * @returns squared length of a + */ + squaredLength(a: Vec4): number; + + /** + * Calculates the squared length of a Vec4 + * + * @param a vector to calculate squared length of + * @returns squared length of a + */ + sqrLen(a: Vec4): number; + + /** + * Negates the components of a Vec4 + * + * @param out the receiving vector + * @param a vector to negate + * @returns out + */ + negate(out: Vec4, a: Vec4): Vec4; + + /** + * Returns the inverse of the components of a Vec4 + * + * @param out the receiving vector + * @param a vector to invert + * @returns out + */ + inverse(out: Vec4, a: Vec4): Vec4; + + /** + * Normalize a Vec4 + * + * @param out the receiving vector + * @param a vector to normalize + * @returns out + */ + normalize(out: Vec4, a: Vec4): Vec4; + + /** + * Calculates the dot product of two Vec4's + * + * @param a the first operand + * @param b the second operand + * @returns dot product of a and b + */ + dot(a: Vec4, b: Vec4): number; + + /** + * Performs a linear interpolation between two Vec4's + * + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @param t interpolation amount between the two inputs + * @returns out + */ + lerp(out: Vec4, a: Vec4, b: Vec4, t: number): Vec4; + + /** + * Generates a random unit vector + * + * @param out the receiving vector + * @returns out + */ + random(out: Vec4): Vec4; + + /** + * Generates a random vector with the given scale + * + * @param out the receiving vector + * @param scale length of the resulting vector. If ommitted, a unit vector + * will be returned + * @returns out + */ + random(out: Vec4, scale: number): Vec4; + + /** + * Transforms the Vec4 with a Mat4. + * + * @param out the receiving vector + * @param a the vector to transform + * @param m matrix to transform with + * @returns out + */ + transformMat4(out: Vec4, a: Vec4, m: Mat4): Vec4; + + /** + * Transforms the Vec4 with a Quat + * + * @param out the receiving vector + * @param a the vector to transform + * @param q Quaternion to transform with + * @returns out + */ + + transformQuat(out: Vec4, a: Vec4, q: Quat): Vec4; + + /** + * Perform some operation over an array of Vec4s. + * + * @param a the array of vectors to iterate over + * @param stride Number of elements between the start of each Vec4. If 0 + * assumes tightly packed + * @param offset Number of elements to skip at the beginning of the array + * @param count Number of Vec4s to iterate over. If 0 iterates over entire + * array + * @param fn Function to call for each vector in the array + * @param arg additional argument to pass to fn + * @returns a + * @function + */ + forEach( + a: Float32Array, stride: number, offset: number, count: number, + fn: (a: Vec4, b: Vec4, arg: any) => void, arg: any): Float32Array; + + /** + * Perform some operation over an array of Vec4s. + * + * @param a the array of vectors to iterate over + * @param stride Number of elements between the start of each Vec4. If 0 + * assumes tightly packed + * @param offset Number of elements to skip at the beginning of the array + * @param count Number of Vec4s to iterate over. If 0 iterates over entire + * array + * @param fn Function to call for each vector in the array + * @returns a + * @function + */ + forEach( + a: Float32Array, stride: number, offset: number, count: number, + fn: (a: Vec4, b: Vec4) => void): Float32Array; + + /** + * Returns a string representation of a vector + * + * @param a vector to represent as a string + * @returns string representation of the vector + */ + str(a: Vec4): string; + + /** + * Returns whether or not the vectors have exactly the same elements in the + * same position (when compared with ===) + * + * @param {Vec4} a The first vector. + * @param {Vec4} b The second vector. + * @returns {boolean} True if the vectors are equal, false otherwise. + */ + exactEquals(a: Vec4, b: Vec4): boolean; + + /** + * Returns whether or not the vectors have approximately the same elements + * in the same position. + * + * @param {Vec4} a The first vector. + * @param {Vec4} b The second vector. + * @returns {boolean} True if the vectors are equal, false otherwise. + */ + equals(a: Vec4, b: Vec4): boolean; +} + +// Mat2 +interface Mat2API { + /** + * Creates a new identity Mat2 + * + * @returns a new 2x2 matrix + */ + create(): Mat2; + + /** + * Creates a new Mat2 initialized with values from an existing matrix + * + * @param a matrix to clone + * @returns a new 2x2 matrix + */ + clone(a: Mat2): Mat2; + + /** + * Copy the values from one Mat2 to another + * + * @param out the receiving matrix + * @param a the source matrix + * @returns out + */ + copy(out: Mat2, a: Mat2): Mat2; + + /** + * Set a Mat2 to the identity matrix + * + * @param out the receiving matrix + * @returns out + */ + identity(out: Mat2): Mat2; + + /** + * Create a new Mat2 with the given values + * + * @param {number} m00 Component in column 0, row 0 position (index 0) + * @param {number} m01 Component in column 0, row 1 position (index 1) + * @param {number} m10 Component in column 1, row 0 position (index 2) + * @param {number} m11 Component in column 1, row 1 position (index 3) + * @returns {Mat2} out A new 2x2 matrix + */ + fromValues(m00: number, m01: number, m10: number, m11: number): Mat2; + + /** + * Set the components of a Mat2 to the given values + * + * @param {Mat2} out the receiving matrix + * @param {number} m00 Component in column 0, row 0 position (index 0) + * @param {number} m01 Component in column 0, row 1 position (index 1) + * @param {number} m10 Component in column 1, row 0 position (index 2) + * @param {number} m11 Component in column 1, row 1 position (index 3) + * @returns {Mat2} out + */ + set(out: Mat2, m00: number, m01: number, m10: number, m11: number): Mat2; + + /** + * Transpose the values of a Mat2 + * + * @param out the receiving matrix + * @param a the source matrix + * @returns out + */ + transpose(out: Mat2, a: Mat2): Mat2; + + /** + * Inverts a Mat2 + * + * @param out the receiving matrix + * @param a the source matrix + * @returns out + */ + invert(out: Mat2, a: Mat2): Mat2|null; + + /** + * Calculates the adjugate of a Mat2 + * + * @param out the receiving matrix + * @param a the source matrix + * @returns out + */ + adjoint(out: Mat2, a: Mat2): Mat2; + + /** + * Calculates the determinant of a Mat2 + * + * @param a the source matrix + * @returns determinant of a + */ + determinant(a: Mat2): number; + + /** + * Multiplies two Mat2's + * + * @param out the receiving matrix + * @param a the first operand + * @param b the second operand + * @returns out + */ + multiply(out: Mat2, a: Mat2, b: Mat2): Mat2; + + /** + * Multiplies two Mat2's + * + * @param out the receiving matrix + * @param a the first operand + * @param b the second operand + * @returns out + */ + mul(out: Mat2, a: Mat2, b: Mat2): Mat2; + + /** + * Rotates a Mat2 by the given angle + * + * @param out the receiving matrix + * @param a the matrix to rotate + * @param rad the angle to rotate the matrix by + * @returns out + */ + rotate(out: Mat2, a: Mat2, rad: number): Mat2; + + /** + * Scales the Mat2 by the dimensions in the given Vec2 + * + * @param out the receiving matrix + * @param a the matrix to rotate + * @param v the Vec2 to scale the matrix by + * @returns out + **/ + scale(out: Mat2, a: Mat2, v: Vec2): Mat2; + + /** + * Creates a matrix from a given angle + * This is equivalent to (but much faster than): + * + * Mat2.identity(dest); + * Mat2.rotate(dest, dest, rad); + * + * @param {Mat2} out Mat2 receiving operation result + * @param {number} rad the angle to rotate the matrix by + * @returns {Mat2} out + */ + fromRotation(out: Mat2, rad: number): Mat2; + + /** + * Creates a matrix from a vector scaling + * This is equivalent to (but much faster than): + * + * Mat2.identity(dest); + * Mat2.scale(dest, dest, vec); + * + * @param {Mat2} out Mat2 receiving operation result + * @param {Vec2} v Scaling vector + * @returns {Mat2} out + */ + fromScaling(out: Mat2, v: Vec2): Mat2; + + /** + * Returns a string representation of a Mat2 + * + * @param a matrix to represent as a string + * @returns string representation of the matrix + */ + str(a: Mat2): string; + + /** + * Returns Frobenius norm of a Mat2 + * + * @param a the matrix to calculate Frobenius norm of + * @returns Frobenius norm + */ + frob(a: Mat2): number; + + /** + * Returns L, D and U matrices (Lower triangular, Diagonal and Upper + * triangular) by factorizing the input matrix + * @param L the lower triangular matrix + * @param D the diagonal matrix + * @param U the upper triangular matrix + * @param a the input matrix to factorize + */ + LDU(L: Mat2, D: Mat2, U: Mat2, a: Mat2): Mat2; + + /** + * Adds two Mat2's + * + * @param {Mat2} out the receiving matrix + * @param {Mat2} a the first operand + * @param {Mat2} b the second operand + * @returns {Mat2} out + */ + add(out: Mat2, a: Mat2, b: Mat2): Mat2; + + /** + * Subtracts matrix b from matrix a + * + * @param {Mat2} out the receiving matrix + * @param {Mat2} a the first operand + * @param {Mat2} b the second operand + * @returns {Mat2} out + */ + subtract(out: Mat2, a: Mat2, b: Mat2): Mat2; + + /** + * Subtracts matrix b from matrix a + * + * @param {Mat2} out the receiving matrix + * @param {Mat2} a the first operand + * @param {Mat2} b the second operand + * @returns {Mat2} out + */ + sub(out: Mat2, a: Mat2, b: Mat2): Mat2; + + /** + * Returns whether or not the matrices have exactly the same elements in the + * same position (when compared with ===) + * + * @param {Mat2} a The first matrix. + * @param {Mat2} b The second matrix. + * @returns {boolean} True if the matrices are equal, false otherwise. + */ + exactEquals(a: Mat2, b: Mat2): boolean; + + /** + * Returns whether or not the matrices have approximately the same elements + * in the same position. + * + * @param {Mat2} a The first matrix. + * @param {Mat2} b The second matrix. + * @returns {boolean} True if the matrices are equal, false otherwise. + */ + equals(a: Mat2, b: Mat2): boolean; + + /** + * Multiply each element of the matrix by a scalar. + * + * @param {Mat2} out the receiving matrix + * @param {Mat2} a the matrix to scale + * @param {number} b amount to scale the matrix's elements by + * @returns {Mat2} out + */ + multiplyScalar(out: Mat2, a: Mat2, b: number): Mat2 + + /** + * Adds two Mat2's after multiplying each element of the second operand + * by a scalar value. + * + * @param {Mat2} out the receiving vector + * @param {Mat2} a the first operand + * @param {Mat2} b the second operand + * @param {number} scale the amount to scale b's elements by before + * adding + * @returns {Mat2} out + */ + multiplyScalarAndAdd(out: Mat2, a: Mat2, b: Mat2, scale: number): Mat2 +} + +// Mat2d +interface Mat2dAPI { + /** + * Creates a new identity Mat2d + * + * @returns a new 2x3 matrix + */ + create(): Mat2d; + + /** + * Creates a new Mat2d initialized with values from an existing matrix + * + * @param a matrix to clone + * @returns a new 2x3 matrix + */ + clone(a: Mat2d): Mat2d; + + /** + * Copy the values from one Mat2d to another + * + * @param out the receiving matrix + * @param a the source matrix + * @returns out + */ + copy(out: Mat2d, a: Mat2d): Mat2d; + + /** + * Set a Mat2d to the identity matrix + * + * @param out the receiving matrix + * @returns out + */ + identity(out: Mat2d): Mat2d; + + /** + * Create a new Mat2d with the given values + * + * @param {number} a Component A (index 0) + * @param {number} b Component B (index 1) + * @param {number} c Component C (index 2) + * @param {number} d Component D (index 3) + * @param {number} tx Component TX (index 4) + * @param {number} ty Component TY (index 5) + * @returns {Mat2d} A new Mat2d + */ + fromValues( + a: number, b: number, c: number, d: number, tx: number, ty: number): Mat2d + + + /** + * Set the components of a Mat2d to the given values + * + * @param {Mat2d} out the receiving matrix + * @param {number} a Component A (index 0) + * @param {number} b Component B (index 1) + * @param {number} c Component C (index 2) + * @param {number} d Component D (index 3) + * @param {number} tx Component TX (index 4) + * @param {number} ty Component TY (index 5) + * @returns {Mat2d} out + */ + set(out: Mat2d, a: number, b: number, c: number, d: number, tx: number, + ty: number): Mat2d + + /** + * Inverts a Mat2d + * + * @param out the receiving matrix + * @param a the source matrix + * @returns out + */ + invert(out: Mat2d, a: Mat2d): Mat2d|null; + + /** + * Calculates the determinant of a Mat2d + * + * @param a the source matrix + * @returns determinant of a + */ + determinant(a: Mat2d): number; + + /** + * Multiplies two Mat2d's + * + * @param out the receiving matrix + * @param a the first operand + * @param b the second operand + * @returns out + */ + multiply(out: Mat2d, a: Mat2d, b: Mat2d): Mat2d; + + /** + * Multiplies two Mat2d's + * + * @param out the receiving matrix + * @param a the first operand + * @param b the second operand + * @returns out + */ + mul(out: Mat2d, a: Mat2d, b: Mat2d): Mat2d; + + /** + * Rotates a Mat2d by the given angle + * + * @param out the receiving matrix + * @param a the matrix to rotate + * @param rad the angle to rotate the matrix by + * @returns out + */ + rotate(out: Mat2d, a: Mat2d, rad: number): Mat2d; + + /** + * Scales the Mat2d by the dimensions in the given Vec2 + * + * @param out the receiving matrix + * @param a the matrix to translate + * @param v the Vec2 to scale the matrix by + * @returns out + **/ + scale(out: Mat2d, a: Mat2d, v: Vec2): Mat2d; + + /** + * Translates the Mat2d by the dimensions in the given Vec2 + * + * @param out the receiving matrix + * @param a the matrix to translate + * @param v the Vec2 to translate the matrix by + * @returns out + **/ + translate(out: Mat2d, a: Mat2d, v: Vec2): Mat2d; + + /** + * Creates a matrix from a given angle + * This is equivalent to (but much faster than): + * + * Mat2d.identity(dest); + * Mat2d.rotate(dest, dest, rad); + * + * @param {Mat2d} out Mat2d receiving operation result + * @param {number} rad the angle to rotate the matrix by + * @returns {Mat2d} out + */ + fromRotation(out: Mat2d, rad: number): Mat2d; + + /** + * Creates a matrix from a vector scaling + * This is equivalent to (but much faster than): + * + * Mat2d.identity(dest); + * Mat2d.scale(dest, dest, vec); + * + * @param {Mat2d} out Mat2d receiving operation result + * @param {Vec2} v Scaling vector + * @returns {Mat2d} out + */ + fromScaling(out: Mat2d, v: Vec2): Mat2d; + + /** + * Creates a matrix from a vector translation + * This is equivalent to (but much faster than): + * + * Mat2d.identity(dest); + * Mat2d.translate(dest, dest, vec); + * + * @param {Mat2d} out Mat2d receiving operation result + * @param {Vec2} v Translation vector + * @returns {Mat2d} out + */ + fromTranslation(out: Mat2d, v: Vec2): Mat2d + + /** + * Returns a string representation of a Mat2d + * + * @param a matrix to represent as a string + * @returns string representation of the matrix + */ + str(a: Mat2d): string; + + /** + * Returns Frobenius norm of a Mat2d + * + * @param a the matrix to calculate Frobenius norm of + * @returns Frobenius norm + */ + frob(a: Mat2d): number; + + /** + * Adds two Mat2d's + * + * @param {Mat2d} out the receiving matrix + * @param {Mat2d} a the first operand + * @param {Mat2d} b the second operand + * @returns {Mat2d} out + */ + add(out: Mat2d, a: Mat2d, b: Mat2d): Mat2d + + /** + * Subtracts matrix b from matrix a + * + * @param {Mat2d} out the receiving matrix + * @param {Mat2d} a the first operand + * @param {Mat2d} b the second operand + * @returns {Mat2d} out + */ + subtract(out: Mat2d, a: Mat2d, b: Mat2d): Mat2d + + /** + * Subtracts matrix b from matrix a + * + * @param {Mat2d} out the receiving matrix + * @param {Mat2d} a the first operand + * @param {Mat2d} b the second operand + * @returns {Mat2d} out + */ + sub(out: Mat2d, a: Mat2d, b: Mat2d): Mat2d + + /** + * Multiply each element of the matrix by a scalar. + * + * @param {Mat2d} out the receiving matrix + * @param {Mat2d} a the matrix to scale + * @param {number} b amount to scale the matrix's elements by + * @returns {Mat2d} out + */ + multiplyScalar(out: Mat2d, a: Mat2d, b: number): Mat2d; + + /** + * Adds two Mat2d's after multiplying each element of the second operand + * by a scalar value. + * + * @param {Mat2d} out the receiving vector + * @param {Mat2d} a the first operand + * @param {Mat2d} b the second operand + * @param {number} scale the amount to scale b's elements by before adding + * @returns {Mat2d} out + */ + multiplyScalarAndAdd(out: Mat2d, a: Mat2d, b: Mat2d, scale: number): Mat2d + + /** + * Returns whether or not the matrices have exactly the same elements in + * the same position (when compared with ===) + * + * @param {Mat2d} a The first matrix. + * @param {Mat2d} b The second matrix. + * @returns {boolean} True if the matrices are equal, false otherwise. + */ + exactEquals(a: Mat2d, b: Mat2d): boolean; + + /** + * Returns whether or not the matrices have approximately the same elements + * in the same position. + * + * @param {Mat2d} a The first matrix. + * @param {Mat2d} b The second matrix. + * @returns {boolean} True if the matrices are equal, false otherwise. + */ + equals(a: Mat2d, b: Mat2d): boolean +} + +// Mat3 +interface Mat3API { + /** + * Creates a new identity Mat3 + * + * @returns a new 3x3 matrix + */ + create(): Mat3; + + /** + * Copies the upper-left 3x3 values into the given Mat3. + * + * @param {Mat3} out the receiving 3x3 matrix + * @param {Mat4} a the source 4x4 matrix + * @returns {Mat3} out + */ + fromMat4(out: Mat3, a: Mat4): Mat3 + + /** + * Creates a new Mat3 initialized with values from an existing matrix + * + * @param a matrix to clone + * @returns a new 3x3 matrix + */ + clone(a: Mat3): Mat3; + + /** + * Copy the values from one Mat3 to another + * + * @param out the receiving matrix + * @param a the source matrix + * @returns out + */ + copy(out: Mat3, a: Mat3): Mat3; + + /** + * Create a new Mat3 with the given values + * + * @param {number} m00 Component in column 0, row 0 position (index 0) + * @param {number} m01 Component in column 0, row 1 position (index 1) + * @param {number} m02 Component in column 0, row 2 position (index 2) + * @param {number} m10 Component in column 1, row 0 position (index 3) + * @param {number} m11 Component in column 1, row 1 position (index 4) + * @param {number} m12 Component in column 1, row 2 position (index 5) + * @param {number} m20 Component in column 2, row 0 position (index 6) + * @param {number} m21 Component in column 2, row 1 position (index 7) + * @param {number} m22 Component in column 2, row 2 position (index 8) + * @returns {Mat3} A new Mat3 + */ + fromValues( + m00: number, m01: number, m02: number, m10: number, m11: number, + m12: number, m20: number, m21: number, m22: number): Mat3; + + + /** + * Set the components of a Mat3 to the given values + * + * @param {Mat3} out the receiving matrix + * @param {number} m00 Component in column 0, row 0 position (index 0) + * @param {number} m01 Component in column 0, row 1 position (index 1) + * @param {number} m02 Component in column 0, row 2 position (index 2) + * @param {number} m10 Component in column 1, row 0 position (index 3) + * @param {number} m11 Component in column 1, row 1 position (index 4) + * @param {number} m12 Component in column 1, row 2 position (index 5) + * @param {number} m20 Component in column 2, row 0 position (index 6) + * @param {number} m21 Component in column 2, row 1 position (index 7) + * @param {number} m22 Component in column 2, row 2 position (index 8) + * @returns {Mat3} out + */ + set(out: Mat3, m00: number, m01: number, m02: number, m10: number, + m11: number, m12: number, m20: number, m21: number, m22: number): Mat3 + + /** + * Set a Mat3 to the identity matrix + * + * @param out the receiving matrix + * @returns out + */ + identity(out: Mat3): Mat3; + + /** + * Transpose the values of a Mat3 + * + * @param out the receiving matrix + * @param a the source matrix + * @returns out + */ + transpose(out: Mat3, a: Mat3): Mat3; + + /** + * Inverts a Mat3 + * + * @param out the receiving matrix + * @param a the source matrix + * @returns out + */ + invert(out: Mat3, a: Mat3): Mat3|null; + + /** + * Calculates the adjugate of a Mat3 + * + * @param out the receiving matrix + * @param a the source matrix + * @returns out + */ + adjoint(out: Mat3, a: Mat3): Mat3; + + /** + * Calculates the determinant of a Mat3 + * + * @param a the source matrix + * @returns determinant of a + */ + determinant(a: Mat3): number; + + /** + * Multiplies two Mat3's + * + * @param out the receiving matrix + * @param a the first operand + * @param b the second operand + * @returns out + */ + multiply(out: Mat3, a: Mat3, b: Mat3): Mat3; + + /** + * Multiplies two Mat3's + * + * @param out the receiving matrix + * @param a the first operand + * @param b the second operand + * @returns out + */ + mul(out: Mat3, a: Mat3, b: Mat3): Mat3; + + + /** + * Translate a Mat3 by the given vector + * + * @param out the receiving matrix + * @param a the matrix to translate + * @param v vector to translate by + * @returns out + */ + translate(out: Mat3, a: Mat3, v: Vec3): Mat3; + + /** + * Rotates a Mat3 by the given angle + * + * @param out the receiving matrix + * @param a the matrix to rotate + * @param rad the angle to rotate the matrix by + * @returns out + */ + rotate(out: Mat3, a: Mat3, rad: number): Mat3; + + /** + * Scales the Mat3 by the dimensions in the given Vec2 + * + * @param out the receiving matrix + * @param a the matrix to rotate + * @param v the Vec2 to scale the matrix by + * @returns out + **/ + scale(out: Mat3, a: Mat3, v: Vec2): Mat3; + + /** + * Creates a matrix from a vector translation + * This is equivalent to (but much faster than): + * + * Mat3.identity(dest); + * Mat3.translate(dest, dest, vec); + * + * @param {Mat3} out Mat3 receiving operation result + * @param {Vec2} v Translation vector + * @returns {Mat3} out + */ + fromTranslation(out: Mat3, v: Vec2): Mat3 + + /** + * Creates a matrix from a given angle + * This is equivalent to (but much faster than): + * + * Mat3.identity(dest); + * Mat3.rotate(dest, dest, rad); + * + * @param {Mat3} out Mat3 receiving operation result + * @param {number} rad the angle to rotate the matrix by + * @returns {Mat3} out + */ + fromRotation(out: Mat3, rad: number): Mat3 + + /** + * Creates a matrix from a vector scaling + * This is equivalent to (but much faster than): + * + * Mat3.identity(dest); + * Mat3.scale(dest, dest, vec); + * + * @param {Mat3} out Mat3 receiving operation result + * @param {Vec2} v Scaling vector + * @returns {Mat3} out + */ + fromScaling(out: Mat3, v: Vec2): Mat3 + + /** + * Copies the values from a Mat2d into a Mat3 + * + * @param out the receiving matrix + * @param {Mat2d} a the matrix to copy + * @returns out + **/ + fromMat2d(out: Mat3, a: Mat2d): Mat3; + + /** + * Calculates a 3x3 matrix from the given Quaternion + * + * @param out Mat3 receiving operation result + * @param q Quaternion to create matrix from + * + * @returns out + */ + fromQuat(out: Mat3, q: Quat): Mat3; + + /** + * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix + * + * @param out Mat3 receiving operation result + * @param a Mat4 to derive the normal matrix from + * + * @returns out + */ + normalFromMat4(out: Mat3, a: Mat4): Mat3|null; + + /** + * Returns a string representation of a Mat3 + * + * @param mat matrix to represent as a string + * @returns string representation of the matrix + */ + str(mat: Mat3): string; + + /** + * Returns Frobenius norm of a Mat3 + * + * @param a the matrix to calculate Frobenius norm of + * @returns Frobenius norm + */ + frob(a: Mat3): number; + + /** + * Adds two Mat3's + * + * @param {Mat3} out the receiving matrix + * @param {Mat3} a the first operand + * @param {Mat3} b the second operand + * @returns {Mat3} out + */ + add(out: Mat3, a: Mat3, b: Mat3): Mat3 + + /** + * Subtracts matrix b from matrix a + * + * @param {Mat3} out the receiving matrix + * @param {Mat3} a the first operand + * @param {Mat3} b the second operand + * @returns {Mat3} out + */ + subtract(out: Mat3, a: Mat3, b: Mat3): Mat3 + + /** + * Subtracts matrix b from matrix a + * + * @param {Mat3} out the receiving matrix + * @param {Mat3} a the first operand + * @param {Mat3} b the second operand + * @returns {Mat3} out + */ + sub(out: Mat3, a: Mat3, b: Mat3): Mat3 + + /** + * Multiply each element of the matrix by a scalar. + * + * @param {Mat3} out the receiving matrix + * @param {Mat3} a the matrix to scale + * @param {number} b amount to scale the matrix's elements by + * @returns {Mat3} out + */ + multiplyScalar(out: Mat3, a: Mat3, b: number): Mat3 + + /** + * Adds two Mat3's after multiplying each element of the second operand + * by a scalar value. + * + * @param {Mat3} out the receiving vector + * @param {Mat3} a the first operand + * @param {Mat3} b the second operand + * @param {number} scale the amount to scale b's elements by before + * adding + * @returns {Mat3} out + */ + multiplyScalarAndAdd(out: Mat3, a: Mat3, b: Mat3, scale: number): Mat3 + + /** + * Returns whether or not the matrices have exactly the same elements in + * the same position (when compared with ===) + * + * @param {Mat3} a The first matrix. + * @param {Mat3} b The second matrix. + * @returns {boolean} True if the matrices are equal, false otherwise. + */ + exactEquals(a: Mat3, b: Mat3): boolean; + + /** + * Returns whether or not the matrices have approximately the same elements + * in the same position. + * + * @param {Mat3} a The first matrix. + * @param {Mat3} b The second matrix. + * @returns {boolean} True if the matrices are equal, false otherwise. + */ + equals(a: Mat3, b: Mat3): boolean +} + +// Mat4 +interface Mat4API { + /** + * Creates a new identity Mat4 + * + * @returns a new 4x4 matrix + */ + create(): Mat4; + + /** + * Creates a new Mat4 initialized with values from an existing matrix + * + * @param a matrix to clone + * @returns a new 4x4 matrix + */ + clone(a: Mat4): Mat4; + + /** + * Copy the values from one Mat4 to another + * + * @param out the receiving matrix + * @param a the source matrix + * @returns out + */ + copy(out: Mat4, a: Mat4): Mat4; + + + /** + * Create a new Mat4 with the given values + * + * @param {number} m00 Component in column 0, row 0 position (index 0) + * @param {number} m01 Component in column 0, row 1 position (index 1) + * @param {number} m02 Component in column 0, row 2 position (index 2) + * @param {number} m03 Component in column 0, row 3 position (index 3) + * @param {number} m10 Component in column 1, row 0 position (index 4) + * @param {number} m11 Component in column 1, row 1 position (index 5) + * @param {number} m12 Component in column 1, row 2 position (index 6) + * @param {number} m13 Component in column 1, row 3 position (index 7) + * @param {number} m20 Component in column 2, row 0 position (index 8) + * @param {number} m21 Component in column 2, row 1 position (index 9) + * @param {number} m22 Component in column 2, row 2 position (index 10) + * @param {number} m23 Component in column 2, row 3 position (index 11) + * @param {number} m30 Component in column 3, row 0 position (index 12) + * @param {number} m31 Component in column 3, row 1 position (index 13) + * @param {number} m32 Component in column 3, row 2 position (index 14) + * @param {number} m33 Component in column 3, row 3 position (index 15) + * @returns {Mat4} A new Mat4 + */ + fromValues( + m00: number, m01: number, m02: number, m03: number, m10: number, + m11: number, m12: number, m13: number, m20: number, m21: number, + m22: number, m23: number, m30: number, m31: number, m32: number, + m33: number): Mat4; + + /** + * Set the components of a Mat4 to the given values + * + * @param {Mat4} out the receiving matrix + * @param {number} m00 Component in column 0, row 0 position (index 0) + * @param {number} m01 Component in column 0, row 1 position (index 1) + * @param {number} m02 Component in column 0, row 2 position (index 2) + * @param {number} m03 Component in column 0, row 3 position (index 3) + * @param {number} m10 Component in column 1, row 0 position (index 4) + * @param {number} m11 Component in column 1, row 1 position (index 5) + * @param {number} m12 Component in column 1, row 2 position (index 6) + * @param {number} m13 Component in column 1, row 3 position (index 7) + * @param {number} m20 Component in column 2, row 0 position (index 8) + * @param {number} m21 Component in column 2, row 1 position (index 9) + * @param {number} m22 Component in column 2, row 2 position (index 10) + * @param {number} m23 Component in column 2, row 3 position (index 11) + * @param {number} m30 Component in column 3, row 0 position (index 12) + * @param {number} m31 Component in column 3, row 1 position (index 13) + * @param {number} m32 Component in column 3, row 2 position (index 14) + * @param {number} m33 Component in column 3, row 3 position (index 15) + * @returns {Mat4} out + */ + set(out: Mat4, m00: number, m01: number, m02: number, m03: number, + m10: number, m11: number, m12: number, m13: number, m20: number, + m21: number, m22: number, m23: number, m30: number, m31: number, + m32: number, m33: number): Mat4; + + /** + * Set a Mat4 to the identity matrix + * + * @param out the receiving matrix + * @returns out + */ + identity(out: Mat4): Mat4; + + /** + * Transpose the values of a Mat4 + * + * @param out the receiving matrix + * @param a the source matrix + * @returns out + */ + transpose(out: Mat4, a: Mat4): Mat4; + + /** + * Inverts a Mat4 + * + * @param out the receiving matrix + * @param a the source matrix + * @returns out + */ + invert(out: Mat4, a: Mat4): Mat4|null; + + /** + * Calculates the adjugate of a Mat4 + * + * @param out the receiving matrix + * @param a the source matrix + * @returns out + */ + adjoint(out: Mat4, a: Mat4): Mat4; + + /** + * Calculates the determinant of a Mat4 + * + * @param a the source matrix + * @returns determinant of a + */ + determinant(a: Mat4): number; + + /** + * Multiplies two Mat4's + * + * @param out the receiving matrix + * @param a the first operand + * @param b the second operand + * @returns out + */ + multiply(out: Mat4, a: Mat4, b: Mat4): Mat4; + + /** + * Multiplies two Mat4's + * + * @param out the receiving matrix + * @param a the first operand + * @param b the second operand + * @returns out + */ + mul(out: Mat4, a: Mat4, b: Mat4): Mat4; + + /** + * Translate a Mat4 by the given vector + * + * @param out the receiving matrix + * @param a the matrix to translate + * @param v vector to translate by + * @returns out + */ + translate(out: Mat4, a: Mat4, v: Vec3): Mat4; + + /** + * Scales the Mat4 by the dimensions in the given Vec3 + * + * @param out the receiving matrix + * @param a the matrix to scale + * @param v the Vec3 to scale the matrix by + * @returns out + **/ + scale(out: Mat4, a: Mat4, v: Vec3): Mat4; + + /** + * Rotates a Mat4 by the given angle + * + * @param out the receiving matrix + * @param a the matrix to rotate + * @param rad the angle to rotate the matrix by + * @param axis the axis to rotate around + * @returns out + */ + rotate(out: Mat4, a: Mat4, rad: number, axis: Vec3): Mat4; + + /** + * Rotates a matrix by the given angle around the X axis + * + * @param out the receiving matrix + * @param a the matrix to rotate + * @param rad the angle to rotate the matrix by + * @returns out + */ + rotateX(out: Mat4, a: Mat4, rad: number): Mat4; + + /** + * Rotates a matrix by the given angle around the Y axis + * + * @param out the receiving matrix + * @param a the matrix to rotate + * @param rad the angle to rotate the matrix by + * @returns out + */ + rotateY(out: Mat4, a: Mat4, rad: number): Mat4; + + /** + * Rotates a matrix by the given angle around the Z axis + * + * @param out the receiving matrix + * @param a the matrix to rotate + * @param rad the angle to rotate the matrix by + * @returns out + */ + rotateZ(out: Mat4, a: Mat4, rad: number): Mat4; + + /** + * Creates a matrix from a vector translation + * This is equivalent to (but much faster than): + * + * Mat4.identity(dest); + * Mat4.translate(dest, dest, vec); + * + * @param {Mat4} out Mat4 receiving operation result + * @param {Vec3} v Translation vector + * @returns {Mat4} out + */ + fromTranslation(out: Mat4, v: Vec3): Mat4 + + /** + * Creates a matrix from a vector scaling + * This is equivalent to (but much faster than): + * + * Mat4.identity(dest); + * Mat4.scale(dest, dest, vec); + * + * @param {Mat4} out Mat4 receiving operation result + * @param {Vec3} v Scaling vector + * @returns {Mat4} out + */ + fromScaling(out: Mat4, v: Vec3): Mat4 + + /** + * Creates a matrix from a given angle around a given axis + * This is equivalent to (but much faster than): + * + * Mat4.identity(dest); + * Mat4.rotate(dest, dest, rad, axis); + * + * @param {Mat4} out Mat4 receiving operation result + * @param {number} rad the angle to rotate the matrix by + * @param {Vec3} axis the axis to rotate around + * @returns {Mat4} out + */ + fromRotation(out: Mat4, rad: number, axis: Vec3): Mat4 + + /** + * Creates a matrix from the given angle around the X axis + * This is equivalent to (but much faster than): + * + * Mat4.identity(dest); + * Mat4.rotateX(dest, dest, rad); + * + * @param {Mat4} out Mat4 receiving operation result + * @param {number} rad the angle to rotate the matrix by + * @returns {Mat4} out + */ + fromXRotation(out: Mat4, rad: number): Mat4 + + /** + * Creates a matrix from the given angle around the Y axis + * This is equivalent to (but much faster than): + * + * Mat4.identity(dest); + * Mat4.rotateY(dest, dest, rad); + * + * @param {Mat4} out Mat4 receiving operation result + * @param {number} rad the angle to rotate the matrix by + * @returns {Mat4} out + */ + fromYRotation(out: Mat4, rad: number): Mat4 + + + /** + * Creates a matrix from the given angle around the Z axis + * This is equivalent to (but much faster than): + * + * Mat4.identity(dest); + * Mat4.rotateZ(dest, dest, rad); + * + * @param {Mat4} out Mat4 receiving operation result + * @param {number} rad the angle to rotate the matrix by + * @returns {Mat4} out + */ + fromZRotation(out: Mat4, rad: number): Mat4 + + /** + * Creates a matrix from a Quaternion rotation and vector translation + * This is equivalent to (but much faster than): + * + * Mat4.identity(dest); + * Mat4.translate(dest, vec); + * var QuatMat = Mat4.create(); + * Quat4.toMat4(Quat, QuatMat); + * Mat4.multiply(dest, QuatMat); + * + * @param out Mat4 receiving operation result + * @param q Rotation Quaternion + * @param v Translation vector + * @returns out + */ + fromRotationTranslation(out: Mat4, q: Quat, v: Vec3): Mat4; + + /** + * Returns the translation vector component of a transformation + * matrix. If a matrix is built with fromRotationTranslation, + * the returned vector will be the same as the translation vector + * originally supplied. + * @param {Vec3} out Vector to receive translation component + * @param {Mat4} mat Matrix to be decomposed (input) + * @return {Vec3} out + */ + getTranslation(out: Vec3, mat: Mat4): Vec3; + + /** + * Returns a Quaternion representing the rotational component + * of a transformation matrix. If a matrix is built with + * fromRotationTranslation, the returned Quaternion will be the + * same as the Quaternion originally supplied. + * @param {Quat} out Quaternion to receive the rotation component + * @param {Mat4} mat Matrix to be decomposed (input) + * @return {Quat} out + */ + getRotation(out: Quat, mat: Mat4): Quat; + + /** + * Creates a matrix from a Quaternion rotation, vector translation and + * vector scale This is equivalent to (but much faster than): + * + * Mat4.identity(dest); + * Mat4.translate(dest, vec); + * var QuatMat = Mat4.create(); + * Quat4.toMat4(Quat, QuatMat); + * Mat4.multiply(dest, QuatMat); + * Mat4.scale(dest, scale) + * + * @param out Mat4 receiving operation result + * @param q Rotation Quaternion + * @param v Translation vector + * @param s Scaling vector + * @returns out + */ + fromRotationTranslationScale(out: Mat4, q: Quat, v: Vec3, s: Vec3): Mat4; + + /** + * Creates a matrix from a Quaternion rotation, vector translation and + * vector scale, rotating and scaling around the given origin This is + * equivalent to (but much faster than): + * + * Mat4.identity(dest); + * Mat4.translate(dest, vec); + * Mat4.translate(dest, origin); + * var QuatMat = Mat4.create(); + * Quat4.toMat4(Quat, QuatMat); + * Mat4.multiply(dest, QuatMat); + * Mat4.scale(dest, scale) + * Mat4.translate(dest, negativeOrigin); + * + * @param {Mat4} out Mat4 receiving operation result + * @param {Quat} q Rotation Quaternion + * @param {Vec3} v Translation vector + * @param {Vec3} s Scaling vector + * @param {Vec3} o The origin vector around which to scale and rotate + * @returns {Mat4} out + */ + fromRotationTranslationScaleOrigin( + out: Mat4, q: Quat, v: Vec3, s: Vec3, o: Vec3): Mat4 + + /** + * Calculates a 4x4 matrix from the given Quaternion + * + * @param {Mat4} out Mat4 receiving operation result + * @param {Quat} q Quaternion to create matrix from + * + * @returns {Mat4} out + */ + fromQuat(out: Mat4, q: Quat): Mat4 + + /** + * Generates a frustum matrix with the given bounds + * + * @param out Mat4 frustum matrix will be written into + * @param left Left bound of the frustum + * @param right Right bound of the frustum + * @param bottom Bottom bound of the frustum + * @param top Top bound of the frustum + * @param near Near bound of the frustum + * @param far Far bound of the frustum + * @returns out + */ + frustum( + out: Mat4, left: number, right: number, bottom: number, top: number, + near: number, far: number): Mat4; + + /** + * Generates a perspective projection matrix with the given bounds + * + * @param out Mat4 frustum matrix will be written into + * @param fovy Vertical field of view in radians + * @param aspect Aspect ratio. typically viewport width/height + * @param near Near bound of the frustum + * @param far Far bound of the frustum + * @returns out + */ + perspective( + out: Mat4, fovy: number, aspect: number, near: number, far: number): Mat4; + + /** + * Generates a perspective projection matrix with the given field of view. + * This is primarily useful for generating projection matrices to be used + * with the still experimental WebVR API. + * + * @param {Mat4} out Mat4 frustum matrix will be written into + * @param {Object} fov Object containing the following values: upDegrees, + * downDegrees, leftDegrees, rightDegrees + * @param {number} near Near bound of the frustum + * @param {number} far Far bound of the frustum + * @returns {Mat4} out + */ + perspectiveFromFieldOfView( + out: Mat4, fov: { + upDegrees: number, + downDegrees: number, + leftDegrees: number, + rightDegrees: number + }, + near: number, far: number): Mat4 + + /** + * Generates a orthogonal projection matrix with the given bounds + * + * @param out Mat4 frustum matrix will be written into + * @param left Left bound of the frustum + * @param right Right bound of the frustum + * @param bottom Bottom bound of the frustum + * @param top Top bound of the frustum + * @param near Near bound of the frustum + * @param far Far bound of the frustum + * @returns out + */ + ortho( + out: Mat4, left: number, right: number, bottom: number, top: number, + near: number, far: number): Mat4; + + /** + * Generates a look-at matrix with the given eye position, focal point, and + * up axis + * + * @param out Mat4 frustum matrix will be written into + * @param eye Position of the viewer + * @param center Point the viewer is looking at + * @param up Vec3 pointing up + * @returns out + */ + lookAt(out: Mat4, eye: Vec3, center: Vec3, up: Vec3): Mat4; + + /** + * Returns a string representation of a Mat4 + * + * @param mat matrix to represent as a string + * @returns string representation of the matrix + */ + str(mat: Mat4): string; + + /** + * Returns Frobenius norm of a Mat4 + * + * @param a the matrix to calculate Frobenius norm of + * @returns Frobenius norm + */ + frob(a: Mat4): number; + + /** + * Adds two Mat4's + * + * @param {Mat4} out the receiving matrix + * @param {Mat4} a the first operand + * @param {Mat4} b the second operand + * @returns {Mat4} out + */ + add(out: Mat4, a: Mat4, b: Mat4): Mat4 + + /** + * Subtracts matrix b from matrix a + * + * @param {Mat4} out the receiving matrix + * @param {Mat4} a the first operand + * @param {Mat4} b the second operand + * @returns {Mat4} out + */ + subtract(out: Mat4, a: Mat4, b: Mat4): Mat4 + + /** + * Subtracts matrix b from matrix a + * + * @param {Mat4} out the receiving matrix + * @param {Mat4} a the first operand + * @param {Mat4} b the second operand + * @returns {Mat4} out + */ + sub(out: Mat4, a: Mat4, b: Mat4): Mat4 + + /** + * Multiply each element of the matrix by a scalar. + * + * @param {Mat4} out the receiving matrix + * @param {Mat4} a the matrix to scale + * @param {number} b amount to scale the matrix's elements by + * @returns {Mat4} out + */ + multiplyScalar(out: Mat4, a: Mat4, b: number): Mat4 + + /** + * Adds two Mat4's after multiplying each element of the second operand + * by a scalar value. + * + * @param {Mat4} out the receiving vector + * @param {Mat4} a the first operand + * @param {Mat4} b the second operand + * @param {number} scale the amount to scale b's elements by before + * adding + * @returns {Mat4} out + */ + multiplyScalarAndAdd(out: Mat4, a: Mat4, b: Mat4, scale: number): Mat4 + + /** + * Returns whether or not the matrices have exactly the same elements in + * the same position (when compared with ===) + * + * @param {Mat4} a The first matrix. + * @param {Mat4} b The second matrix. + * @returns {boolean} True if the matrices are equal, false otherwise. + */ + exactEquals(a: Mat4, b: Mat4): boolean + + /** + * Returns whether or not the matrices have approximately the same + * elements in the same position. + * + * @param {Mat4} a The first matrix. + * @param {Mat4} b The second matrix. + * @returns {boolean} True if the matrices are equal, false otherwise. + */ + equals(a: Mat4, b: Mat4): boolean +} + +// Quat +interface QuatAPI { + /** + * Creates a new identity Quat + * + * @returns a new Quaternion + */ + create(): Quat; + + /** + * Creates a new Quat initialized with values from an existing Quaternion + * + * @param a Quaternion to clone + * @returns a new Quaternion + * @function + */ + clone(a: Quat): Quat; + + /** + * Creates a new Quat initialized with the given values + * + * @param x X component + * @param y Y component + * @param z Z component + * @param w W component + * @returns a new Quaternion + * @function + */ + fromValues(x: number, y: number, z: number, w: number): Quat; + + /** + * Copy the values from one Quat to another + * + * @param out the receiving Quaternion + * @param a the source Quaternion + * @returns out + * @function + */ + copy(out: Quat, a: Quat): Quat; + + /** + * Set the components of a Quat to the given values + * + * @param out the receiving Quaternion + * @param x X component + * @param y Y component + * @param z Z component + * @param w W component + * @returns out + * @function + */ + set(out: Quat, x: number, y: number, z: number, w: number): Quat; + + /** + * Set a Quat to the identity Quaternion + * + * @param out the receiving Quaternion + * @returns out + */ + identity(out: Quat): Quat; + + /** + * Sets a Quaternion to represent the shortest rotation from one + * vector to another. + * + * Both vectors are assumed to be unit length. + * + * @param {Quat} out the receiving Quaternion. + * @param {Vec3} a the initial vector + * @param {Vec3} b the destination vector + * @returns {Quat} out + */ + rotationTo(out: Quat, a: Vec3, b: Vec3): Quat; + + /** + * Sets the specified Quaternion with values corresponding to the given + * axes. Each axis is a Vec3 and is expected to be unit length and + * perpendicular to all other specified axes. + * + * @param {Vec3} view the vector representing the viewing direction + * @param {Vec3} right the vector representing the local "right" direction + * @param {Vec3} up the vector representing the local "up" direction + * @returns {Quat} out + */ + setAxes(out: Quat, view: Vec3, right: Vec3, up: Vec3): Quat + + + + /** + * Sets a Quat from the given angle and rotation axis, + * then returns it. + * + * @param out the receiving Quaternion + * @param axis the axis around which to rotate + * @param rad the angle in radians + * @returns out + **/ + setAxisAngle(out: Quat, axis: Vec3, rad: number): Quat; + + /** + * Gets the rotation axis and angle for a given + * Quaternion. If a Quaternion is created with + * setAxisAngle, this method will return the same + * values as providied in the original parameter list + * OR functionally equivalent values. + * Example: The Quaternion formed by axis [0, 0, 1] and + * angle -90 is the same as the Quaternion formed by + * [0, 0, 1] and 270. This method favors the latter. + * @param {Vec3} out_axis Vector receiving the axis of rotation + * @param {Quat} q Quaternion to be decomposed + * @return {number} Angle, in radians, of the rotation + */ + getAxisAngle(out_axis: Vec3, q: Quat): number + + /** + * Adds two Quat's + * + * @param out the receiving Quaternion + * @param a the first operand + * @param b the second operand + * @returns out + * @function + */ + add(out: Quat, a: Quat, b: Quat): Quat; + + /** + * Multiplies two Quat's + * + * @param out the receiving Quaternion + * @param a the first operand + * @param b the second operand + * @returns out + */ + multiply(out: Quat, a: Quat, b: Quat): Quat; + + /** + * Multiplies two Quat's + * + * @param out the receiving Quaternion + * @param a the first operand + * @param b the second operand + * @returns out + */ + mul(out: Quat, a: Quat, b: Quat): Quat; + + /** + * Scales a Quat by a scalar number + * + * @param out the receiving vector + * @param a the vector to scale + * @param b amount to scale the vector by + * @returns out + * @function + */ + scale(out: Quat, a: Quat, b: number): Quat; + + /** + * Calculates the length of a Quat + * + * @param a vector to calculate length of + * @returns length of a + * @function + */ + length(a: Quat): number; + + /** + * Calculates the length of a Quat + * + * @param a vector to calculate length of + * @returns length of a + * @function + */ + len(a: Quat): number; + + /** + * Calculates the squared length of a Quat + * + * @param a vector to calculate squared length of + * @returns squared length of a + * @function + */ + squaredLength(a: Quat): number; + + /** + * Calculates the squared length of a Quat + * + * @param a vector to calculate squared length of + * @returns squared length of a + * @function + */ + sqrLen(a: Quat): number; + + /** + * Normalize a Quat + * + * @param out the receiving Quaternion + * @param a Quaternion to normalize + * @returns out + * @function + */ + normalize(out: Quat, a: Quat): Quat; + + /** + * Calculates the dot product of two Quat's + * + * @param a the first operand + * @param b the second operand + * @returns dot product of a and b + * @function + */ + dot(a: Quat, b: Quat): number; + + /** + * Performs a linear interpolation between two Quat's + * + * @param out the receiving Quaternion + * @param a the first operand + * @param b the second operand + * @param t interpolation amount between the two inputs + * @returns out + * @function + */ + lerp(out: Quat, a: Quat, b: Quat, t: number): Quat; + + /** + * Performs a spherical linear interpolation between two Quat + * + * @param out the receiving Quaternion + * @param a the first operand + * @param b the second operand + * @param t interpolation amount between the two inputs + * @returns out + */ + slerp(out: Quat, a: Quat, b: Quat, t: number): Quat; + + /** + * Performs a spherical linear interpolation with two control points + * + * @param {Quat} out the receiving Quaternion + * @param {Quat} a the first operand + * @param {Quat} b the second operand + * @param {Quat} c the third operand + * @param {Quat} d the fourth operand + * @param {number} t interpolation amount + * @returns {Quat} out + */ + sqlerp(out: Quat, a: Quat, b: Quat, c: Quat, d: Quat, t: number): Quat; + + /** + * Calculates the inverse of a Quat + * + * @param out the receiving Quaternion + * @param a Quat to calculate inverse of + * @returns out + */ + invert(out: Quat, a: Quat): Quat; + + /** + * Calculates the conjugate of a Quat + * If the Quaternion is normalized, this function is faster than + * Quat.inverse and produces the same result. + * + * @param out the receiving Quaternion + * @param a Quat to calculate conjugate of + * @returns out + */ + conjugate(out: Quat, a: Quat): Quat; + + /** + * Returns a string representation of a Quaternion + * + * @param a Quat to represent as a string + * @returns string representation of the Quat + */ + str(a: Quat): string; + + /** + * Rotates a Quaternion by the given angle about the X axis + * + * @param out Quat receiving operation result + * @param a Quat to rotate + * @param rad angle (in radians) to rotate + * @returns out + */ + rotateX(out: Quat, a: Quat, rad: number): Quat; + + /** + * Rotates a Quaternion by the given angle about the Y axis + * + * @param out Quat receiving operation result + * @param a Quat to rotate + * @param rad angle (in radians) to rotate + * @returns out + */ + rotateY(out: Quat, a: Quat, rad: number): Quat; + + /** + * Rotates a Quaternion by the given angle about the Z axis + * + * @param out Quat receiving operation result + * @param a Quat to rotate + * @param rad angle (in radians) to rotate + * @returns out + */ + rotateZ(out: Quat, a: Quat, rad: number): Quat; + + /** + * Creates a Quaternion from the given 3x3 rotation matrix. + * + * NOTE: The resultant Quaternion is not normalized, so you should be sure + * to renormalize the Quaternion yourself where necessary. + * + * @param out the receiving Quaternion + * @param m rotation matrix + * @returns out + * @function + */ + fromMat3(out: Quat, m: Mat3): Quat; + + /** + * Sets the specified Quaternion with values corresponding to the given + * axes. Each axis is a Vec3 and is expected to be unit length and + * perpendicular to all other specified axes. + * + * @param out the receiving Quat + * @param view the vector representing the viewing direction + * @param right the vector representing the local "right" direction + * @param up the vector representing the local "up" direction + * @returns out + */ + setAxes(out: Quat, view: Vec3, right: Vec3, up: Vec3): Quat; + + /** + * Sets a Quaternion to represent the shortest rotation from one + * vector to another. + * + * Both vectors are assumed to be unit length. + * + * @param out the receiving Quaternion. + * @param a the initial vector + * @param b the destination vector + * @returns out + */ + rotationTo(out: Quat, a: Vec3, b: Vec3): Quat; + + /** + * Calculates the W component of a Quat from the X, Y, and Z components. + * Assumes that Quaternion is 1 unit in length. + * Any existing W component will be ignored. + * + * @param out the receiving Quaternion + * @param a Quat to calculate W component of + * @returns out + */ + calculateW(out: Quat, a: Quat): Quat; + + /** + * Returns whether or not the Quaternions have exactly the same elements in + * the same position (when compared with ===) + * + * @param {Quat} a The first vector. + * @param {Quat} b The second vector. + * @returns {boolean} True if the Quaternions are equal, false otherwise. + */ + exactEquals(a: Quat, b: Quat): boolean; + + /** + * Returns whether or not the Quaternions have approximately the same + * elements in the same position. + * + * @param {Quat} a The first vector. + * @param {Quat} b The second vector. + * @returns {boolean} True if the Quaternions are equal, false otherwise. + */ + equals(a: Quat, b: Quat): boolean; +} diff --git a/examples.js b/examples.js new file mode 100644 index 000000000..ece85b855 --- /dev/null +++ b/examples.js @@ -0,0 +1,560 @@ +// 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 demonstrates how redundant points along a polygon can be + // used to make twisted extrusions smoother. It also showcases animated + // assemblies. Based on the screw puzzle by George Hart: + // https://www.thingiverse.com/thing:186372 + + const edgeLength = 50; // Length of each edge of the overall tetrahedron. + const gap = 0.2; // Spacing between the two halves to allow sliding. + const nDivisions = 50; // Divisions (both ways) in the screw surface. + + const scale = edgeLength / (2 * Math.sqrt(2)); + + const tet = Manifold.tetrahedron().intersect( + Manifold.tetrahedron().rotate([0, 0, 90]).scale(2.5)); + + const box = []; + box.push([2, -2], [2, 2]); + for (let i = 0; i <= nDivisions; ++i) { + box.push([gap / (2 * scale), 2 - i * 4 / nDivisions]); + } + + const cyan = [0, 1, 1]; + const magenta = [1, 0, 1]; + const fade = (color, pos) => { + for (let i = 0; i < 3; ++i) { + const x = pos[2] / 2; + color[i] = cyan[i] * x + magenta[i] * (1 - x); + } + }; + + // setProperties(3, fade) creates three channels of vertex properties + // according to the above fade function. setMaterial assigns these + // channels as colors, and sets the factor to white, since our default is + // yellow. + const screw = setMaterial( + Manifold.extrude(box, 2, nDivisions, 270).setProperties(3, fade), + {baseColorFactor: [1, 1, 1], attributes: ['COLOR_0']}); + + const result = + tet.intersect(screw.rotate([0, 0, -45]).translate([0, 0, -1])) + .scale(scale); + + // Assigned materials are only applied to a GLTFNode. Note that material + // definitions cascade, applying recursively to all child surfaces, but + // overridden by any materials defined lower down. The default material + // properties, as well as animation parameters can be set via + // globalDefaults. + + const layFlat = new GLTFNode(); + layFlat.rotation = + [45, -Math.atan(1 / Math.sqrt(2)) * 180 / Math.PI, 120]; + layFlat.translation = [0, 0, scale * Math.sqrt(3) / 3]; + + const fixed = new GLTFNode(layFlat); + fixed.manifold = result; + fixed.rotation = [0, 0, 180]; + + // For 3MF export, only top-level objects are independently arrangeable. + const layFlat2 = layFlat.clone(); + + const moving = new GLTFNode(layFlat2); + moving.manifold = result; + // Use functions to create animation, which runs from t=0 to t=1. + moving.translation = (t) => { + const a = 1 - t; + const x = a > 0.5 ? scale * 2 * (0.5 - a) : 0; + return [x, x, -2 * x + scale * 4 * (0.5 - Math.abs(0.5 - a))]; + }; + moving.rotation = (t) => [0, 0, 270 * 2 * (1 - t)]; + + globalDefaults.animationLength = 10; // seconds + globalDefaults.animationMode = 'ping-pong'; + return result; + }, + + RoundedFrame: function() { + // Demonstrates how at 90-degree intersections, the sphere and cylinder + // facets match up perfectly, for any choice of global resolution + // parameters. + const {sphere, cylinder, union} = 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 + // It also demonstrates the use of setMorph to animate a warping function. + + const func = (v) => { + const x2 = v[0] * v[0]; + const y2 = v[1] * v[1]; + const z = v[2]; + const z2 = z * z; + const a = x2 + 9 / 4 * y2 + z2; + const b = z * z2 * (x2 + 9 / 80 * y2); + const a2 = a * a; + const a3 = a * a2; + + const step = (r) => { + const r2 = r * r; + const r4 = r2 * r2; + // Taubin's function: https://mathworld.wolfram.com/HeartSurface.html + const f = a3 * r4 * r2 - b * r4 * r - 3 * a2 * r4 + 3 * a * r2 - 1; + // Derivative + const df = + 6 * a3 * r4 * r - 5 * b * r4 - 12 * a2 * r2 * r + 6 * a * r; + return f / df; + }; + // Newton's method for root finding + let r = 1.5; + let dr = 1; + while (Math.abs(dr) > 0.0001) { + dr = step(r); + r -= dr; + } + // Update radius + v[0] *= r; + v[1] *= r; + v[2] *= r; + }; + + const ball = Manifold.sphere(1, 200); + + const heart = ball.warp(func); + const box = heart.boundingBox(); + const scale = 100 / (box.max[0] - box.min[0]); + + setMorphStart(ball, func); + const node = new GLTFNode(); + node.manifold = ball; + node.scale = [scale, scale, scale]; + + globalDefaults.animationLength = 5; // seconds + globalDefaults.animationMode = 'ping-pong'; + + const result = heart.scale(scale); + return result; + }, + + Scallop: function() { + // A smoothed manifold demonstrating selective edge sharpening with + // smooth() and refine(), see more details at: + // https://elalish.blogspot.com/2022/03/smoothing-triangle-meshes.html + + const height = 10; + const radius = 30; + const offset = 20; + const wiggles = 12; + const sharpness = 0.6; + const n = 50; + + const positions = []; + const triangles = []; + positions.push(-offset, 0, height, -offset, 0, -height); + const sharpenedEdges = []; + + const delta = 3.14159 / wiggles; + for (let i = 0; i < 2 * wiggles; ++i) { + const theta = (i - wiggles) * delta; + const amp = 0.5 * height * Math.max(Math.cos(0.8 * theta), 0); + + positions.push( + radius * Math.cos(theta), radius * Math.sin(theta), + amp * (i % 2 == 0 ? 1 : -1)); + let j = i + 1; + if (j == 2 * wiggles) j = 0; + + const smoothness = 1 - sharpness * Math.cos((theta + delta / 2) / 2); + let halfedge = triangles.length + 1; + sharpenedEdges.push({halfedge, smoothness}); + triangles.push(0, 2 + i, 2 + j); + + halfedge = triangles.length + 1; + sharpenedEdges.push({halfedge, smoothness}); + triangles.push(1, 2 + j, 2 + i); + } + + const triVerts = Uint32Array.from(triangles); + const vertProperties = Float32Array.from(positions); + const scallop = new Mesh({numProp: 3, triVerts, vertProperties}); + + const colorCurvature = (color, pos, oldProp) => { + const a = Math.max(0, Math.min(1, oldProp[0] / 3 + 0.5)); + const b = a * a * (3 - 2 * a); + const red = [1, 0, 0]; + const blue = [0, 0, 1]; + for (let i = 0; i < 3; ++i) { + color[i] = (1 - b) * blue[i] + b * red[i]; + } + }; + const result = Manifold.smooth(scallop, sharpenedEdges) + .refine(n) + .calculateCurvature(-1, 0) + .setProperties(3, colorCurvature); + + const node = new GLTFNode(); + node.manifold = result; + node.material = { + baseColorFactor: [1, 1, 1], + metallic: 0, + attributes: ['COLOR_0'] + }; + return result; + }, + + TorusKnot: function() { + // Creates a classic torus knot, defined as a string wrapping periodically + // around the surface of an imaginary donut. If p and q have a common + // factor then you will get multiple separate, interwoven knots. This is + // an example of using the warp() method, thus avoiding any direct + // handling of triangles. + + // The number of times the thread passes through the donut hole. + const p = 1; + // The number of times the thread circles the donut. + const q = 3; + // Radius of the interior of the imaginary donut. + const majorRadius = 25; + // Radius of the small cross-section of the imaginary donut. + const minorRadius = 10; + // Radius of the small cross-section of the actual object. + const threadRadius = 3.75; + // Number of linear segments making up the threadRadius circle. Default is + // getCircularSegments(threadRadius). + const circularSegments = -1; + // Number of segments along the length of the knot. Default makes roughly + // square facets. + const linearSegments = -1; + + // These default values recreate Matlab Knot by Emmett Lalish: + // https://www.thingiverse.com/thing:7080 + + const {vec3} = glMatrix; + + function gcd(a, b) { + return b == 0 ? a : gcd(b, a % b); + } + + const kLoops = gcd(p, q); + const pk = p / kLoops; + const qk = q / kLoops; + const n = circularSegments > 2 ? circularSegments : + getCircularSegments(threadRadius); + const m = linearSegments > 2 ? linearSegments : + n * qk * majorRadius / threadRadius; + + const offset = 2 + const circle = CrossSection.circle(1, n).translate([offset, 0]); + + const func = (v) => { + const psi = qk * Math.atan2(v[0], v[1]); + const theta = psi * pk / qk; + const x1 = Math.sqrt(v[0] * v[0] + v[1] * v[1]); + const phi = Math.atan2(x1 - offset, v[2]); + vec3.set( + v, threadRadius * Math.cos(phi), 0, threadRadius * Math.sin(phi)); + const center = vec3.fromValues(0, 0, 0); + const r = majorRadius + minorRadius * Math.cos(theta); + vec3.rotateX(v, v, center, -Math.atan2(pk * minorRadius, qk * r)); + v[0] += minorRadius; + vec3.rotateY(v, v, center, theta); + v[0] += majorRadius; + vec3.rotateZ(v, v, center, psi); + }; + + const result = Manifold.revolve(circle, m).warp(func); + + for (let k = 0; k < kLoops; ++k) { + const node = new GLTFNode(); + node.manifold = result; + node.rotation = [0, 0, 360 * (k / kLoops) * (qk / pk)]; + node.translation = [0, 0, result.boundingBox().min[2]]; + } + + return result; + }, + + MengerSponge: function() { + // This example demonstrates how symbolic perturbation correctly creates + // holes even though the subtracted objects are exactly coplanar. + const {vec2} = glMatrix; + + function fractal(holes, hole, w, position, depth, maxDepth) { + w /= 3; + holes.push( + hole.scale([w, w, 1.0]).translate([position[0], position[1], 0.0])); + if (depth == maxDepth) return; + const offsets = [ + vec2.fromValues(-w, -w), vec2.fromValues(-w, 0.0), + vec2.fromValues(-w, w), vec2.fromValues(0.0, w), + vec2.fromValues(w, w), vec2.fromValues(w, 0.0), + vec2.fromValues(w, -w), vec2.fromValues(0.0, -w) + ]; + for (let offset of offsets) + fractal( + holes, hole, w, vec2.add(offset, position, offset), depth + 1, + maxDepth); + } + + function mengerSponge(n) { + let result = Manifold.cube([1, 1, 1], true); + const holes = []; + fractal(holes, result, 1.0, [0.0, 0.0], 1, n); + + const hole = Manifold.compose(holes); + + result = Manifold.difference([ + result, + hole, + hole.rotate([90, 0, 0]), + hole.rotate([0, 90, 0]), + ]); + return result; + } + + const posColors = (newProp, pos) => { + for (let i = 0; i < 3; ++i) { + newProp[i] = (1 - pos[i]) / 2; + } + }; + + const result = mengerSponge(3) + .trimByPlane([1, 1, 1], 0) + .setProperties(3, posColors) + .scale(100); + + const node = new GLTFNode(); + node.manifold = result; + node.material = {baseColorFactor: [1, 1, 1], attributes: ['COLOR_0']}; + return result; + }, + + StretchyBracelet: function() { + // Recreates Stretchy Bracelet by Emmett Lalish: + // https://www.thingiverse.com/thing:13505 + const {vec2} = glMatrix; + + function base( + width, radius, decorRadius, twistRadius, nDecor, innerRadius, + outerRadius, cut, nCut, nDivision) { + let b = Manifold.cylinder(width, radius + twistRadius / 2); + const circle = []; + const dPhiDeg = 180 / nDivision; + for (let i = 0; i < 2 * nDivision; ++i) { + circle.push([ + decorRadius * Math.cos(dPhiDeg * i * Math.PI / 180) + twistRadius, + decorRadius * Math.sin(dPhiDeg * i * Math.PI / 180) + ]); + } + let decor = Manifold.extrude(circle, width, nDivision, 180) + .scale([1, 0.5, 1]) + .translate([0, radius, 0]); + for (let i = 0; i < nDecor; i++) + b = b.add(decor.rotate([0, 0, (360.0 / nDecor) * i])); + const stretch = []; + const dPhiRad = 2 * Math.PI / nCut; + + const o = vec2.fromValues(0, 0); + const p0 = vec2.fromValues(outerRadius, 0); + const p1 = vec2.fromValues(innerRadius, -cut); + const p2 = vec2.fromValues(innerRadius, cut); + for (let i = 0; i < nCut; ++i) { + stretch.push(vec2.rotate([0, 0], p0, o, dPhiRad * i)); + stretch.push(vec2.rotate([0, 0], p1, o, dPhiRad * i)); + stretch.push(vec2.rotate([0, 0], p2, o, dPhiRad * i)); + stretch.push(vec2.rotate([0, 0], p0, o, dPhiRad * i)); + } + const result = + Manifold.intersection(Manifold.extrude(stretch, width), b); + return result; + } + + function stretchyBracelet( + radius = 30, height = 8, width = 15, thickness = 0.4, nDecor = 20, + nCut = 27, nDivision = 30) { + const twistRadius = Math.PI * radius / nDecor; + const decorRadius = twistRadius * 1.5; + const outerRadius = radius + (decorRadius + twistRadius) * 0.5; + const innerRadius = outerRadius - height; + const cut = 0.5 * (Math.PI * 2 * innerRadius / nCut - thickness); + const adjThickness = 0.5 * thickness * height / cut; + + return Manifold.difference( + base( + width, radius, decorRadius, twistRadius, nDecor, + innerRadius + thickness, outerRadius + adjThickness, + cut - adjThickness, nCut, nDivision), + base( + width, radius - thickness, decorRadius, twistRadius, nDecor, + innerRadius, outerRadius + 3 * adjThickness, cut, nCut, + nDivision)); + } + + const result = stretchyBracelet(); + return result; + }, + + GyroidModule: function() { + // Recreates Modular Gyroid Puzzle by Emmett Lalish: + // https://www.thingiverse.com/thing:25477. This sample demonstrates the + // use of a Signed Distance Function (SDF) to create smooth, complex + // manifolds. + const {vec3} = glMatrix; + + // number of modules along pyramid edge (use 1 for print orientation) + const m = 4; + // module size + const size = 20; + // SDF resolution + const n = 20; + + const pi = 3.14159; + + function gyroid(p) { + const x = p[0] - pi / 4; + const y = p[1] - pi / 4; + const z = p[2] - pi / 4; + return Math.cos(x) * Math.sin(y) + Math.cos(y) * Math.sin(z) + + Math.cos(z) * Math.sin(x); + } + + function gyroidOffset(level) { + const period = 2 * pi; + const box = { + min: vec3.fromValues(-period, -period, -period), + max: vec3.fromValues(period, period, period) + }; + return Manifold.levelSet(gyroid, box, period / n, level) + .scale(size / period); + }; + + function rhombicDodecahedron() { + const box = Manifold.cube([1, 1, 2], true).scale(size * Math.sqrt(2)); + const result = + box.rotate([90, 45, 0]).intersect(box.rotate([90, 45, 90])); + return result.intersect(box.rotate([0, 0, 45])); + } + + const gyroidModule = rhombicDodecahedron() + .intersect(gyroidOffset(-0.4)) + .subtract(gyroidOffset(0.4)); + + if (m > 1) { + for (let i = 0; i < m; ++i) { + for (let j = i; j < m; ++j) { + for (let k = j; k < m; ++k) { + const node = new GLTFNode(); + node.manifold = gyroidModule; + node.translation = + [(k + i - j) * size, (k - i) * size, (-j) * size]; + node.material = { + baseColorFactor: + [(k + i - j + 1) / m, (k - i + 1) / m, (j + 1) / m] + }; + } + } + } + } + + const result = gyroidModule.rotate([-45, 0, 90]).translate([ + 0, 0, size / Math.sqrt(2) + ]); + return result; + } + }, + + functionBodies: new Map() +}; + +for (const [func, code] of Object.entries(examples.functions)) { + const whole = code.toString(); + const lines = whole.split('\n'); + lines.splice(0, 1); // remove first line + lines.splice(-2, 2); // remove last two lines + // remove first six leading spaces + const body = '\n' + lines.map(l => l.slice(6)).join('\n'); + + const name = + func.replace(/([a-z])([A-Z])/g, '$1 $2'); // Add spaces between words + examples.functionBodies.set(name, body); +}; + +if (typeof self !== 'undefined') { + self.examples = examples; +} diff --git a/icons/close.png b/icons/close.png new file mode 100644 index 000000000..461cc3c94 Binary files /dev/null and b/icons/close.png differ diff --git a/icons/manifoldCAD.png b/icons/manifoldCAD.png new file mode 100644 index 000000000..4f7e5854d Binary files /dev/null and b/icons/manifoldCAD.png differ diff --git a/icons/manifoldCADonly.png b/icons/manifoldCADonly.png new file mode 100644 index 000000000..01d542cd6 Binary files /dev/null and b/icons/manifoldCADonly.png differ diff --git a/icons/mengerSponge192.png b/icons/mengerSponge192.png new file mode 100644 index 000000000..c53801c1f Binary files /dev/null and b/icons/mengerSponge192.png differ diff --git a/icons/mengerSponge512.png b/icons/mengerSponge512.png new file mode 100644 index 000000000..c1cc43349 Binary files /dev/null and b/icons/mengerSponge512.png differ diff --git a/icons/pause.png b/icons/pause.png new file mode 100644 index 000000000..c7cc4ca50 Binary files /dev/null and b/icons/pause.png differ diff --git a/icons/pencil.png b/icons/pencil.png new file mode 100644 index 000000000..faaa762ff Binary files /dev/null and b/icons/pencil.png differ diff --git a/icons/play.png b/icons/play.png new file mode 100644 index 000000000..06ff4a02d Binary files /dev/null and b/icons/play.png differ diff --git a/icons/redo.png b/icons/redo.png new file mode 100644 index 000000000..00b24a953 Binary files /dev/null and b/icons/redo.png differ diff --git a/icons/share.png b/icons/share.png new file mode 100644 index 000000000..e24c06044 Binary files /dev/null and b/icons/share.png differ diff --git a/icons/star.png b/icons/star.png new file mode 100644 index 000000000..320d8b8b0 Binary files /dev/null and b/icons/star.png differ diff --git a/icons/trash.png b/icons/trash.png new file mode 100644 index 000000000..2b5c0d7bf Binary files /dev/null and b/icons/trash.png differ diff --git a/icons/undo.png b/icons/undo.png new file mode 100644 index 000000000..6f6a4ed6e Binary files /dev/null and b/icons/undo.png differ diff --git a/index.html b/index.html new file mode 100644 index 000000000..b55eda711 --- /dev/null +++ b/index.html @@ -0,0 +1,103 @@ + + + + + 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..21ae63e34 --- /dev/null +++ b/make-manifold.html @@ -0,0 +1,69 @@ + + + + + Make manifold glTF + + + + + + + + + + + +

Load a glTF/GLB model and our Manifold library will attempt to + merge it into a set of manifold objects. If the model is water-tight, you can download the new GLB which will have + our EXT_mesh_manifold extension, thus preserving the + manifold data without losing any mesh properties.

+

If the View Manifold GLB checkbox is enabled, then some meshes in the model have open edges and don't represent a + solid object. Check this box to see only the manifold parts, which will also enable them to be downloaded. If the + download button is still disabled, it means there were no manifold meshes found.

+ + + + + + Drop a GLB here + + + + + + \ No newline at end of file diff --git a/manifest.json b/manifest.json new file mode 100644 index 000000000..c49420c67 --- /dev/null +++ b/manifest.json @@ -0,0 +1,42 @@ +{ + "name": "ManifoldCAD", + "icons": [ + { + "src": "/icons/mengerSponge192.png", + "type": "image/png", + "sizes": "192x192" + }, + { + "src": "/icons/mengerSponge512.png", + "type": "image/png", + "sizes": "512x512" + } + ], + "id": "/", + "start_url": "/", + "background_color": "#FFFFFF", + "display": "standalone", + "orientation": "landscape", + "scope": "/", + "theme_color": "#A288B3", + "description": "Fast, reliable, parametric solid modeling web app. Programmatic 3D design with JavaScript, inspired by and improving upon OpenSCAD & JSCAD. Demonstrates a new GPU-parallel, open-source geometry kernel: Manifold.", + "categories": [ + "design", + "developer", + "education", + "graphics", + "productivity" + ], + "screenshots": [ + { + "src": "/icons/manifoldCAD.png", + "type": "image/png", + "sizes": "2906x1980" + }, + { + "src": "/icons/manifoldCADonly.png", + "type": "image/png", + "sizes": "2906x1980" + } + ] +} \ No newline at end of file diff --git a/manifold-encapsulated-types.d.ts b/manifold-encapsulated-types.d.ts new file mode 100644 index 000000000..a558a7e7b --- /dev/null +++ b/manifold-encapsulated-types.d.ts @@ -0,0 +1,959 @@ +// 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; + + /** + * Smooths out the Manifold by filling in the halfedgeTangent vectors. The + * geometry will remain unchanged until Refine or RefineToLength is called to + * interpolate the surface. This version uses the supplied vertex normal + * properties to define the tangent vectors. + * + * @param normalIdx The first property channel of the normals. NumProp must be + * at least normalIdx + 3. Any vertex where multiple normals exist and don't + * agree will result in a sharp edge. + */ + smoothByNormals(normalIdx: number): Manifold; + + /** + * Smooths out the Manifold by filling in the halfedgeTangent vectors. The + * geometry will remain unchanged until Refine or RefineToLength is called to + * interpolate the surface. This version uses the geometry of the triangles + * and pseudo-normals to define the tangent vectors. + * + * @param minSharpAngle degrees, default 60. Any edges with angles greater + * than this value will remain sharp. The rest will be smoothed to G1 + * continuity, with the caveat that flat faces of three or more triangles will + * always remain flat. With a value of zero, the model is faceted, but in this + * case there is no point in smoothing. + * + * @param minSmoothness range: 0 - 1, default 0. The smoothness applied to + * sharp angles. The default gives a hard edge, while values > 0 will give a + * small fillet on these sharp edges. A value of 1 is equivalent to a + * minSharpAngle of 180 - all edges will be smooth. + */ + smoothOut(minSharpAngle?: number, minSmoothness?: number): Manifold; + + /** + * Increase the density of the mesh by splitting every edge into n pieces. For + * instance, with n = 2, each triangle will be split into 4 triangles. These + * will all be coplanar (and will not be immediately collapsed) unless the + * Mesh/Manifold has halfedgeTangents specified (e.g. from the Smooth() + * constructor), in which case the new vertices will be moved to the + * interpolated surface according to their barycentric coordinates. + * + * @param n The number of pieces to split every edge into. Must be > 1. + */ + refine(n: number): Manifold; + + /** + * Increase the density of the mesh by splitting each edge into pieces of + * roughly the input length. Interior verts are added to keep the rest of the + * triangulation edges also of roughly the same length. If halfedgeTangents + * are present (e.g. from the Smooth() constructor), the new vertices will be + * moved to the interpolated surface according to their barycentric + * coordinates. + * + * @param length The length that edges will be broken down to. + */ + refineToLength(length: number): Manifold; + + /** + * Create a new copy of this manifold with updated vertex properties by + * supplying a function that takes the existing position and properties as + * input. You may specify any number of output properties, allowing creation + * and removal of channels. Note: undefined behavior will result if you read + * past the number of input properties or write past the number of output + * properties. + * + * @param numProp The new number of properties per vertex. + * @param propFunc A function that modifies the properties of a given vertex. + */ + setProperties( + numProp: number, + propFunc: (newProp: number[], position: Vec3, oldProp: number[]) => void): + Manifold; + + /** + * Curvature is the inverse of the radius of curvature, and signed such that + * positive is convex and negative is concave. There are two orthogonal + * principal curvatures at any point on a manifold, with one maximum and the + * other minimum. Gaussian curvature is their product, while mean + * curvature is their sum. This approximates them for every vertex and assigns + * them as vertex properties on the given channels. + * + * @param gaussianIdx The property channel index in which to store the + * Gaussian curvature. An index < 0 will be ignored (stores nothing). The + * property set will be automatically expanded to include the channel + * index specified. + * @param meanIdx The property channel index in which to store the mean + * curvature. An index < 0 will be ignored (stores nothing). The property + * set will be automatically expanded to include the channel index + * specified. + */ + calculateCurvature(gaussianIdx: number, meanIdx: number): Manifold; + + /** + * Fills in vertex properties for normal vectors, calculated from the mesh + * geometry. Flat faces composed of three or more triangles will remain flat. + * + * @param normalIdx The property channel in which to store the X + * values of the normals. The X, Y, and Z channels will be sequential. The + * property set will be automatically expanded to include up through normalIdx + * + 2. + * + * @param minSharpAngle Any edges with angles greater than this value will + * remain sharp, getting different normal vector properties on each side of + * the edge. By default, no edges are sharp and all normals are shared. With a + * value of zero, the model is faceted and all normals match their triangle + * normals, but in this case it would be better not to calculate normals at + * all. + */ + calculateNormals(normalIdx: number, minSharpAngle: number): Manifold; + + // Boolean Operations + + /** + * Boolean union + */ + add(other: Manifold): Manifold; + + /** + * Boolean difference + */ + subtract(other: Manifold): Manifold; + + /** + * Boolean intersection + */ + intersect(other: Manifold): Manifold; + + /** + * Boolean union of the manifolds a and b + */ + static union(a: Manifold, b: Manifold): Manifold; + + /** + * Boolean difference of the manifold b from the manifold a + */ + static difference(a: Manifold, b: Manifold): Manifold; + + /** + * Boolean intersection of the manifolds a and b + */ + static intersection(a: Manifold, b: Manifold): Manifold; + + /** + * Boolean union of a list of manifolds + */ + static union(manifolds: Manifold[]): Manifold; + + /** + * Boolean difference of the tail of a list of manifolds from its head + */ + static difference(manifolds: Manifold[]): Manifold; + + /** + * Boolean intersection of a list of manifolds + */ + static intersection(manifolds: Manifold[]): Manifold; + + /** + * Split cuts this manifold in two using the cutter manifold. The first result + * is the intersection, second is the difference. This is more efficient than + * doing them separately. + * + * @param cutter + */ + split(cutter: Manifold): Manifold[]; + + /** + * Convenient version of Split() for a half-space. + * + * @param normal This vector is normal to the cutting plane and its length + * does + * not matter. The first result is in the direction of this vector, the second + * result is on the opposite side. + * @param originOffset The distance of the plane from the origin in the + * direction of the normal vector. + */ + splitByPlane(normal: Vec3, originOffset: number): Manifold[]; + + /** + * Removes everything behind the given half-space plane. + * + * @param normal This vector is normal to the cutting plane and its length + * does not matter. The result is in the direction of this vector from the + * plane. + * @param originOffset The distance of the plane from the origin in the + * direction of the normal vector. + */ + trimByPlane(normal: Vec3, originOffset: number): Manifold; + + /** + * Returns the cross section of this object parallel to the X-Y plane at the + * specified height. Using a height equal to the bottom + * of the bounding box will return the bottom faces, while using a height + * equal to the top of the bounding box will return empty. + * + * @param height Z-level of slice. + */ + slice(height: number): CrossSection; + + /** + * Returns a cross section representing the projected outline of this object + * onto the X-Y plane. + */ + project(): CrossSection; + + // Convex Hulls + + /** + * Compute the convex hull of all points in this Manifold. + */ + hull(): Manifold; + + /** + * Compute the convex hull of all points contained within a set of Manifolds + * and point vectors. + */ + static hull(points: (Manifold|Vec3)[]): Manifold; + + // Topological Operations + + /** + * Constructs a new manifold from a list of other manifolds. This is a purely + * topological operation, so care should be taken to avoid creating + * overlapping results. It is the inverse operation of Decompose(). + * + * @param manifolds A list of Manifolds to lazy-union together. + */ + static compose(manifolds: Manifold[]): Manifold; + + /** + * This operation returns a vector of Manifolds that are topologically + * disconnected. If everything is connected, the vector is length one, + * containing a copy of the original. It is the inverse operation of + * Compose(). + */ + decompose(): Manifold[]; + + // Property Access + + /** + * Does the Manifold have any triangles? + */ + isEmpty(): boolean; + + /** + * The number of vertices in the Manifold. + */ + numVert(): number; + + /** + * The number of triangles in the Manifold. + */ + numTri(): number; + + /** + * The number of edges in the Manifold. + */ + numEdge(): number; + + /** + * The number of properties per vertex in the Manifold. + */ + numProp(): number; + + /** + * The number of property vertices in the Manifold. This will always be >= + * numVert, as some physical vertices may be duplicated to account for + * different properties on different neighboring triangles. + */ + numPropVert(): number + + /** + * Returns the axis-aligned bounding box of all the Manifold's vertices. + */ + boundingBox(): Box; + + /** + * Returns the precision of this Manifold's vertices, which tracks the + * approximate rounding error over all the transforms and operations that have + * led to this state. Any triangles that are colinear within this precision + * are considered degenerate and removed. This is the value of ε + * defining + * [ε-valid](https://github.com/elalish/manifold/wiki/Manifold-Library#definition-of-%CE%B5-valid). + */ + precision(): number; + + /** + * The genus is a topological property of the manifold, representing the + * number of "handles". A sphere is 0, torus 1, etc. It is only meaningful for + * a single mesh, so it is best to call Decompose() first. + */ + genus(): number; + + /** + * Returns the surface area and volume of the manifold. These properties are + * clamped to zero for a given face if they are within the Precision(). This + * means degenerate manifolds can by identified by testing these properties as + * == 0. + */ + getProperties(): Properties; + + + /* + * Returns the minimum gap between two manifolds. Returns a float between + * 0 and searchLength. + */ + minGap(other: Manifold, searchLength: number): number; + + // Export + + /** + * Returns a Mesh that is designed to easily push into a renderer, including + * all interleaved vertex properties that may have been input. It also + * includes relations to all the input meshes that form a part of this result + * and the transforms applied to each. + * + * @param normalIdx If the original Mesh inputs that formed this manifold had + * properties corresponding to normal vectors, you can specify which property + * channels these are (x, y, z), which will cause this output Mesh to + * automatically update these normals according to the applied transforms and + * front/back side. Each channel must be >= 3 and < numProp, and all original + * Meshes must use the same channels for their normals. + */ + getMesh(normalIdx?: Vec3): Mesh; + + // ID Management + + /** + * If you copy a manifold, but you want this new copy to have new properties + * (e.g. a different UV mapping), you can reset its IDs to a new original, + * meaning it will now be referenced by its descendants instead of the meshes + * it was built from, allowing you to differentiate the copies when applying + * your properties to the final result. + * + * This function also condenses all coplanar faces in the relation, and + * collapses those edges. If you want to have inconsistent properties across + * these faces, meaning you want to preserve some of these edges, you should + * instead call GetMesh(), calculate your properties and use these to + * construct a new manifold. + */ + asOriginal(): Manifold; + + /** + * If this mesh is an original, this returns its ID that can be referenced + * by product manifolds. If this manifold is a product, this + * returns -1. + */ + originalID(): number; + + /** + * Returns the first of n sequential new unique mesh IDs for marking sets of + * triangles that can be looked up after further operations. Assign to + * Mesh.runOriginalID vector. + */ + static reserveIDs(count: number): number; + + // Memory + + /** + * Frees the WASM memory of this Manifold, since these cannot be + * garbage-collected automatically. + */ + delete(): void; +} + +export interface MeshOptions { + numProp: number; + vertProperties: Float32Array; + triVerts: Uint32Array; + mergeFromVert?: Uint32Array; + mergeToVert?: Uint32Array; + runIndex?: Uint32Array; + runOriginalID?: Uint32Array; + runTransform?: Float32Array; + faceID?: Uint32Array; + halfedgeTangent?: Float32Array; +} + +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/manifold.js b/manifold.js new file mode 100644 index 000000000..8db4871e4 --- /dev/null +++ b/manifold.js @@ -0,0 +1,16 @@ + +var Module = (() => { + var _scriptDir = import.meta.url; + + return ( +async function(moduleArg = {}) { + +var Module=moduleArg;var readyPromiseResolve,readyPromiseReject;Module["ready"]=new Promise((resolve,reject)=>{readyPromiseResolve=resolve;readyPromiseReject=reject});var _ManifoldInitialized=false;Module.setup=function(){if(_ManifoldInitialized)return;_ManifoldInitialized=true;function toVec(vec,list,f=(x=>x)){if(list){for(let x of list){vec.push_back(f(x))}}return vec}function fromVec(vec,f=(x=>x)){const result=[];const size=vec.size();for(let i=0;ix)){const result=[];const nPoly=vec.size();for(let i=0;itoVec(new Module.Vector_vec2,poly,p=>{if(p instanceof Array)return{x:p[0],y:p[1]};return p}))}function disposePolygons(polygonsVec){for(let i=0;iresult.min[f]),max:["x","y"].map(f=>result.max[f])}};Module.CrossSection.prototype.offset=function(delta,joinType="Square",miterLimit=2,circularSegments=0){return this._Offset(delta,joinTypeToInt(joinType),miterLimit,circularSegments)};Module.CrossSection.prototype.extrude=function(height,nDivisions=0,twistDegrees=0,scaleTop=[1,1],center=false){scaleTop=vararg2vec2([scaleTop]);const man=Module._Extrude(this,height,nDivisions,twistDegrees,scaleTop);return center?man.translate([0,0,-height/2]):man};Module.CrossSection.prototype.revolve=function(circularSegments=0,revolveDegrees=360){return Module._Revolve(this,circularSegments,revolveDegrees)};Module.CrossSection.prototype.add=function(other){return this._add(cross(other))};Module.CrossSection.prototype.subtract=function(other){return this._subtract(cross(other))};Module.CrossSection.prototype.intersect=function(other){return this._intersect(cross(other))};Module.CrossSection.prototype.toPolygons=function(){const vec=this._ToPolygons();const result=vec2polygons(vec);vec.delete();return result};Module.Manifold.prototype.warp=function(func){const wasmFuncPtr=addFunction(function(vec3Ptr){const x=getValue(vec3Ptr,"float");const y=getValue(vec3Ptr+4,"float");const z=getValue(vec3Ptr+8,"float");const vert=[x,y,z];func(vert);setValue(vec3Ptr,vert[0],"float");setValue(vec3Ptr+4,vert[1],"float");setValue(vec3Ptr+8,vert[2],"float")},"vi");const out=this._Warp(wasmFuncPtr);removeFunction(wasmFuncPtr);const status=out.status();if(status.value!==0){throw new Module.ManifoldError(status.value)}return out};Module.Manifold.prototype.setProperties=function(numProp,func){const oldNumProp=this.numProp();const wasmFuncPtr=addFunction(function(newPtr,vec3Ptr,oldPtr){const newProp=[];for(let i=0;iresult.min[f]),max:["x","y","z"].map(f=>result.max[f])}};class Mesh{constructor({numProp:numProp=3,triVerts:triVerts=new Uint32Array,vertProperties:vertProperties=new Float32Array,mergeFromVert:mergeFromVert,mergeToVert:mergeToVert,runIndex:runIndex,runOriginalID:runOriginalID,faceID:faceID,halfedgeTangent:halfedgeTangent,runTransform:runTransform}={}){this.numProp=numProp;this.triVerts=triVerts;this.vertProperties=vertProperties;this.mergeFromVert=mergeFromVert;this.mergeToVert=mergeToVert;this.runIndex=runIndex;this.runOriginalID=runOriginalID;this.faceID=faceID;this.halfedgeTangent=halfedgeTangent;this.runTransform=runTransform}get numTri(){return this.triVerts.length/3}get numVert(){return this.vertProperties.length/this.numProp}get numRun(){return this.runOriginalID.length}merge(){const{changed:changed,mesh:mesh}=Module._Merge(this);Object.assign(this,{...mesh});return changed}verts(tri){return this.triVerts.subarray(3*tri,3*(tri+1))}position(vert){return this.vertProperties.subarray(numProp*vert,numProp*vert+3)}extras(vert){return this.vertProperties.subarray(numProp*vert+3,numProp*(vert+1))}tangent(halfedge){return this.halfedgeTangent.subarray(4*halfedge,4*(halfedge+1))}transform(run){const mat4=new Array(16);for(const col of[0,1,2,3]){for(const row of[0,1,2]){mat4[4*col+row]=this.runTransform[12*run+3*col+row]}}mat4[15]=1;return mat4}}Module.Mesh=Mesh;Module.Manifold.prototype.getMesh=function(normalIdx=[0,0,0]){if(normalIdx instanceof Array)normalIdx={0:normalIdx[0],1:normalIdx[1],2:normalIdx[2]};return new Mesh(this._GetMeshJS(normalIdx))};Module.ManifoldError=function ManifoldError(code,...args){let message="Unknown error";switch(code){case Module.status.NonFiniteVertex.value:message="Non-finite vertex";break;case Module.status.NotManifold.value:message="Not manifold";break;case Module.status.VertexOutOfBounds.value:message="Vertex index out of bounds";break;case Module.status.PropertiesWrongLength.value:message="Properties have wrong length";break;case Module.status.MissingPositionProperties.value:message="Less than three properties";break;case Module.status.MergeVectorsDifferentLengths.value:message="Merge vectors have different lengths";break;case Module.status.MergeIndexOutOfBounds.value:message="Merge index out of bounds";break;case Module.status.TransformWrongLength.value:message="Transform vector has wrong length";break;case Module.status.RunIndexWrongLength.value:message="Run index vector has wrong length";break;case Module.status.FaceIDWrongLength.value:message="Face ID vector has wrong length";case Module.status.InvalidConstruction.value:message="Manifold constructed with invalid parameters"}const base=Error.apply(this,[message,...args]);base.name=this.name="ManifoldError";this.message=base.message;this.stack=base.stack;this.code=code};Module.ManifoldError.prototype=Object.create(Error.prototype,{constructor:{value:Module.ManifoldError,writable:true,configurable:true}});Module.CrossSection=function(polygons,fillRule="Positive"){const polygonsVec=polygons2vec(polygons);const cs=new CrossSectionCtor(polygonsVec,fillRuleToInt(fillRule));disposePolygons(polygonsVec);return cs};Module.CrossSection.ofPolygons=function(polygons,fillRule="Positive"){return new Module.CrossSection(polygons,fillRule)};Module.CrossSection.square=function(...args){let size=undefined;if(args.length==0)size={x:1,y:1};else if(typeof args[0]=="number")size={x:args[0],y:args[0]};else size=vararg2vec2(args);const center=args[1]||false;return Module._Square(size,center)};Module.CrossSection.circle=function(radius,circularSegments=0){return Module._Circle(radius,circularSegments)};function crossSectionBatchbool(name){return function(...args){if(args.length==1)args=args[0];const v=new Module.Vector_crossSection;for(const cs of args)v.push_back(cross(cs));const result=Module["_crossSection"+name](v);v.delete();return result}}Module.CrossSection.compose=crossSectionBatchbool("Compose");Module.CrossSection.union=crossSectionBatchbool("UnionN");Module.CrossSection.difference=crossSectionBatchbool("DifferenceN");Module.CrossSection.intersection=crossSectionBatchbool("IntersectionN");function pushVec2(vec,ps){toVec(vec,ps,p=>{if(p instanceof Array)return{x:p[0],y:p[1]};return p})}Module.CrossSection.hull=function(...args){if(args.length==1)args=args[0];let pts=new Module.Vector_vec2;for(const cs of args){if(cs instanceof CrossSectionCtor){Module._crossSectionCollectVertices(pts,cs)}else if(cs instanceof Array&&cs.length==2&&typeof cs[0]=="number"){pts.push_back({x:cs[0],y:cs[1]})}else if(cs.x){pts.push_back(cs)}else{const wrap=cs[0].length==2&&typeof cs[0][0]=="number"||cs[0].x;const polys=wrap?[cs]:cs;for(const poly of polys)pushVec2(pts,poly)}}const result=Module._crossSectionHullPoints(pts);pts.delete();return result};Module.CrossSection.prototype=Object.create(CrossSectionCtor.prototype);Object.defineProperty(Module.CrossSection,Symbol.hasInstance,{get:()=>t=>t instanceof CrossSectionCtor});const ManifoldCtor=Module.Manifold;Module.Manifold=function(mesh){const manifold=new ManifoldCtor(mesh);const status=manifold.status();if(status.value!==0){throw new Module.ManifoldError(status.value)}return manifold};Module.Manifold.ofMesh=function(mesh){return new Module.Manifold(mesh)};Module.Manifold.tetrahedron=function(){return Module._Tetrahedron()};Module.Manifold.cube=function(...args){let size=undefined;if(args.length==0)size={x:1,y:1,z:1};else if(typeof args[0]=="number")size={x:args[0],y:args[0],z:args[0]};else size=vararg2vec3(args);const center=args[1]||false;return Module._Cube(size,center)};Module.Manifold.cylinder=function(height,radiusLow,radiusHigh=-1,circularSegments=0,center=false){return Module._Cylinder(height,radiusLow,radiusHigh,circularSegments,center)};Module.Manifold.sphere=function(radius,circularSegments=0){return Module._Sphere(radius,circularSegments)};Module.Manifold.smooth=function(mesh,sharpenedEdges=[]){const sharp=new Module.Vector_smoothness;toVec(sharp,sharpenedEdges);const result=Module._Smooth(mesh,sharp);sharp.delete();return result};Module.Manifold.extrude=function(polygons,height,nDivisions=0,twistDegrees=0,scaleTop=[1,1],center=false){const cs=polygons instanceof CrossSectionCtor?polygons:Module.CrossSection(polygons,"Positive");return cs.extrude(height,nDivisions,twistDegrees,scaleTop,center)};Module.Manifold.revolve=function(polygons,circularSegments=0,revolveDegrees=360){const cs=polygons instanceof CrossSectionCtor?polygons:Module.CrossSection(polygons,"Positive");return cs.revolve(circularSegments,revolveDegrees)};Module.Manifold.reserveIDs=function(n){return Module._ReserveIDs(n)};Module.Manifold.compose=function(manifolds){const vec=new Module.Vector_manifold;toVec(vec,manifolds);const result=Module._manifoldCompose(vec);vec.delete();return result};function manifoldBatchbool(name){return function(...args){if(args.length==1)args=args[0];const v=new Module.Vector_manifold;for(const m of args)v.push_back(m);const result=Module["_manifold"+name+"N"](v);v.delete();return result}}Module.Manifold.union=manifoldBatchbool("Union");Module.Manifold.difference=manifoldBatchbool("Difference");Module.Manifold.intersection=manifoldBatchbool("Intersection");Module.Manifold.levelSet=function(sdf,bounds,edgeLength,level=0){const bounds2={min:{x:bounds.min[0],y:bounds.min[1],z:bounds.min[2]},max:{x:bounds.max[0],y:bounds.max[1],z:bounds.max[2]}};const wasmFuncPtr=addFunction(function(vec3Ptr){const x=getValue(vec3Ptr,"float");const y=getValue(vec3Ptr+4,"float");const z=getValue(vec3Ptr+8,"float");const vert=[x,y,z];return sdf(vert)},"fi");const out=Module._LevelSet(wasmFuncPtr,bounds2,edgeLength,level);removeFunction(wasmFuncPtr);return out};function pushVec3(vec,ps){toVec(vec,ps,p=>{if(p instanceof Array)return{x:p[0],y:p[1],z:p[2]};return p})}Module.Manifold.hull=function(...args){if(args.length==1)args=args[0];let pts=new Module.Vector_vec3;for(const m of args){if(m instanceof ManifoldCtor){Module._manifoldCollectVertices(pts,m)}else if(m instanceof Array&&m.length==3&&typeof m[0]=="number"){pts.push_back({x:m[0],y:m[1],z:m[2]})}else if(m.x){pts.push_back(m)}else{pushVec3(pts,m)}}const result=Module._manifoldHullPoints(pts);pts.delete();return result};Module.Manifold.prototype=Object.create(ManifoldCtor.prototype);Object.defineProperty(Module.Manifold,Symbol.hasInstance,{get:()=>t=>t instanceof ManifoldCtor});Module.triangulate=function(polygons,precision=-1){const polygonsVec=polygons2vec(polygons);const result=fromVec(Module._Triangulate(polygonsVec,precision),x=>[x[0],x[1],x[2]]);disposePolygons(polygonsVec);return result}};var moduleOverrides=Object.assign({},Module);var arguments_=[];var thisProgram="./this.program";var quit_=(status,toThrow)=>{throw toThrow};var ENVIRONMENT_IS_WEB=typeof window=="object";var ENVIRONMENT_IS_WORKER=typeof importScripts=="function";var ENVIRONMENT_IS_NODE=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string";var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;if(ENVIRONMENT_IS_NODE){const{createRequire:createRequire}=await import("module");var require=createRequire(import.meta.url);var fs=require("fs");var nodePath=require("path");if(ENVIRONMENT_IS_WORKER){scriptDirectory=nodePath.dirname(scriptDirectory)+"/"}else{scriptDirectory=require("url").fileURLToPath(new URL("./",import.meta.url))}read_=(filename,binary)=>{filename=isFileURI(filename)?new URL(filename):nodePath.normalize(filename);return fs.readFileSync(filename,binary?undefined:"utf8")};readBinary=filename=>{var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}return ret};readAsync=(filename,onload,onerror,binary=true)=>{filename=isFileURI(filename)?new URL(filename):nodePath.normalize(filename);fs.readFile(filename,binary?undefined:"utf8",(err,data)=>{if(err)onerror(err);else onload(binary?data.buffer:data)})};if(!Module["thisProgram"]&&process.argv.length>1){thisProgram=process.argv[1].replace(/\\/g,"/")}arguments_=process.argv.slice(2);quit_=(status,toThrow)=>{process.exitCode=status;throw toThrow};Module["inspect"]=()=>"[Emscripten Module object]"}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(_scriptDir){scriptDirectory=_scriptDir}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.replace(/[?#].*/,"").lastIndexOf("/")+1)}else{scriptDirectory=""}{read_=url=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=url=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=(url,onload,onerror)=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=()=>{if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=title=>document.title=title}else{}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.error.bind(console);Object.assign(Module,moduleOverrides);moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!="object"){abort("no native wasm support detected")}var wasmMemory;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort(text)}}var HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateMemoryViews(){var b=wasmMemory.buffer;Module["HEAP8"]=HEAP8=new Int8Array(b);Module["HEAP16"]=HEAP16=new Int16Array(b);Module["HEAPU8"]=HEAPU8=new Uint8Array(b);Module["HEAPU16"]=HEAPU16=new Uint16Array(b);Module["HEAP32"]=HEAP32=new Int32Array(b);Module["HEAPU32"]=HEAPU32=new Uint32Array(b);Module["HEAPF32"]=HEAPF32=new Float32Array(b);Module["HEAPF64"]=HEAPF64=new Float64Array(b)}var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;function preRun(){if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();FS.ignorePermissions=false;TTY.init();callRuntimeCallbacks(__ATINIT__)}function postRun(){if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}what="Aborted("+what+")";err(what);ABORT=true;EXITSTATUS=1;what+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(what);readyPromiseReject(e);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile;if(Module["locateFile"]){wasmBinaryFile="manifold.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}}else{wasmBinaryFile=new URL("manifold.wasm",import.meta.url).href}function getBinarySync(file){if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}throw"both async and sync fetching of the wasm failed"}function getBinaryPromise(binaryFile){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch=="function"&&!isFileURI(binaryFile)){return fetch(binaryFile,{credentials:"same-origin"}).then(response=>{if(!response["ok"]){throw"failed to load wasm binary file at '"+binaryFile+"'"}return response["arrayBuffer"]()}).catch(()=>getBinarySync(binaryFile))}else if(readAsync){return new Promise((resolve,reject)=>{readAsync(binaryFile,response=>resolve(new Uint8Array(response)),reject)})}}return Promise.resolve().then(()=>getBinarySync(binaryFile))}function instantiateArrayBuffer(binaryFile,imports,receiver){return getBinaryPromise(binaryFile).then(binary=>WebAssembly.instantiate(binary,imports)).then(instance=>instance).then(receiver,reason=>{err(`failed to asynchronously prepare wasm: ${reason}`);abort(reason)})}function instantiateAsync(binary,binaryFile,imports,callback){if(!binary&&typeof WebAssembly.instantiateStreaming=="function"&&!isDataURI(binaryFile)&&!isFileURI(binaryFile)&&!ENVIRONMENT_IS_NODE&&typeof fetch=="function"){return fetch(binaryFile,{credentials:"same-origin"}).then(response=>{var result=WebAssembly.instantiateStreaming(response,imports);return result.then(callback,function(reason){err(`wasm streaming compile failed: ${reason}`);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(binaryFile,imports,callback)})})}return instantiateArrayBuffer(binaryFile,imports,callback)}function createWasm(){var info={"a":wasmImports};function receiveInstance(instance,module){var exports=instance.exports;wasmExports=exports;wasmMemory=wasmExports["Ua"];updateMemoryViews();wasmTable=wasmExports["Wa"];addOnInit(wasmExports["Va"]);removeRunDependency("wasm-instantiate");return exports}addRunDependency("wasm-instantiate");function receiveInstantiationResult(result){receiveInstance(result["instance"])}if(Module["instantiateWasm"]){try{return Module["instantiateWasm"](info,receiveInstance)}catch(e){err(`Module.instantiateWasm callback failed with error: ${e}`);readyPromiseReject(e)}}instantiateAsync(wasmBinary,wasmBinaryFile,info,receiveInstantiationResult).catch(readyPromiseReject);return{}}var tempDouble;var tempI64;var callRuntimeCallbacks=callbacks=>{while(callbacks.length>0){callbacks.shift()(Module)}};function getValue(ptr,type="i8"){if(type.endsWith("*"))type="*";switch(type){case"i1":return HEAP8[ptr>>0];case"i8":return HEAP8[ptr>>0];case"i16":return HEAP16[ptr>>1];case"i32":return HEAP32[ptr>>2];case"i64":abort("to do getValue(i64) use WASM_BIGINT");case"float":return HEAPF32[ptr>>2];case"double":return HEAPF64[ptr>>3];case"*":return HEAPU32[ptr>>2];default:abort(`invalid type for getValue: ${type}`)}}function setValue(ptr,value,type="i8"){if(type.endsWith("*"))type="*";switch(type){case"i1":HEAP8[ptr>>0]=value;break;case"i8":HEAP8[ptr>>0]=value;break;case"i16":HEAP16[ptr>>1]=value;break;case"i32":HEAP32[ptr>>2]=value;break;case"i64":abort("to do setValue(i64) use WASM_BIGINT");case"float":HEAPF32[ptr>>2]=value;break;case"double":HEAPF64[ptr>>3]=value;break;case"*":HEAPU32[ptr>>2]=value;break;default:abort(`invalid type for setValue: ${type}`)}}var exceptionCaught=[];var uncaughtExceptionCount=0;var ___cxa_begin_catch=ptr=>{var info=new ExceptionInfo(ptr);if(!info.get_caught()){info.set_caught(true);uncaughtExceptionCount--}info.set_rethrown(false);exceptionCaught.push(info);___cxa_increment_exception_refcount(info.excPtr);return info.get_exception_ptr()};var exceptionLast=0;var ___cxa_end_catch=()=>{_setThrew(0,0);var info=exceptionCaught.pop();___cxa_decrement_exception_refcount(info.excPtr);exceptionLast=0};function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-24;this.set_type=function(type){HEAPU32[this.ptr+4>>2]=type};this.get_type=function(){return HEAPU32[this.ptr+4>>2]};this.set_destructor=function(destructor){HEAPU32[this.ptr+8>>2]=destructor};this.get_destructor=function(){return HEAPU32[this.ptr+8>>2]};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+12>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+12>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+13>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+13>>0]!=0};this.init=function(type,destructor){this.set_adjusted_ptr(0);this.set_type(type);this.set_destructor(destructor)};this.set_adjusted_ptr=function(adjustedPtr){HEAPU32[this.ptr+16>>2]=adjustedPtr};this.get_adjusted_ptr=function(){return HEAPU32[this.ptr+16>>2]};this.get_exception_ptr=function(){var isPointer=___cxa_is_pointer_type(this.get_type());if(isPointer){return HEAPU32[this.excPtr>>2]}var adjusted=this.get_adjusted_ptr();if(adjusted!==0)return adjusted;return this.excPtr}}var ___resumeException=ptr=>{if(!exceptionLast){exceptionLast=ptr}throw exceptionLast};var findMatchingCatch=args=>{var thrown=exceptionLast;if(!thrown){setTempRet0(0);return 0}var info=new ExceptionInfo(thrown);info.set_adjusted_ptr(thrown);var thrownType=info.get_type();if(!thrownType){setTempRet0(0);return thrown}for(var arg in args){var caughtType=args[arg];if(caughtType===0||caughtType===thrownType){break}var adjusted_ptr_addr=info.ptr+16;if(___cxa_can_catch(caughtType,thrownType,adjusted_ptr_addr)){setTempRet0(caughtType);return thrown}}setTempRet0(thrownType);return thrown};var ___cxa_find_matching_catch_2=()=>findMatchingCatch([]);var ___cxa_find_matching_catch_3=arg0=>findMatchingCatch([arg0]);var ___cxa_rethrow=()=>{var info=exceptionCaught.pop();if(!info){abort("no exception to throw")}var ptr=info.excPtr;if(!info.get_rethrown()){exceptionCaught.push(info);info.set_rethrown(true);info.set_caught(false);uncaughtExceptionCount++}exceptionLast=ptr;throw exceptionLast};var ___cxa_throw=(ptr,type,destructor)=>{var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw exceptionLast};var ___cxa_uncaught_exceptions=()=>uncaughtExceptionCount;var structRegistrations={};var runDestructors=destructors=>{while(destructors.length){var ptr=destructors.pop();var del=destructors.pop();del(ptr)}};function simpleReadValueFromPointer(pointer){return this["fromWireType"](HEAP32[pointer>>2])}var awaitingDependencies={};var registeredTypes={};var typeDependencies={};var InternalError=undefined;var throwInternalError=message=>{throw new InternalError(message)};var whenDependentTypesAreResolved=(myTypes,dependentTypes,getTypeConverters)=>{myTypes.forEach(function(type){typeDependencies[type]=dependentTypes});function onComplete(typeConverters){var myTypeConverters=getTypeConverters(typeConverters);if(myTypeConverters.length!==myTypes.length){throwInternalError("Mismatched type converter count")}for(var i=0;i{if(registeredTypes.hasOwnProperty(dt)){typeConverters[i]=registeredTypes[dt]}else{unregisteredTypes.push(dt);if(!awaitingDependencies.hasOwnProperty(dt)){awaitingDependencies[dt]=[]}awaitingDependencies[dt].push(()=>{typeConverters[i]=registeredTypes[dt];++registered;if(registered===unregisteredTypes.length){onComplete(typeConverters)}})}});if(0===unregisteredTypes.length){onComplete(typeConverters)}};var __embind_finalize_value_object=structType=>{var reg=structRegistrations[structType];delete structRegistrations[structType];var rawConstructor=reg.rawConstructor;var rawDestructor=reg.rawDestructor;var fieldRecords=reg.fields;var fieldTypes=fieldRecords.map(field=>field.getterReturnType).concat(fieldRecords.map(field=>field.setterArgumentType));whenDependentTypesAreResolved([structType],fieldTypes,fieldTypes=>{var fields={};fieldRecords.forEach((field,i)=>{var fieldName=field.fieldName;var getterReturnType=fieldTypes[i];var getter=field.getter;var getterContext=field.getterContext;var setterArgumentType=fieldTypes[i+fieldRecords.length];var setter=field.setter;var setterContext=field.setterContext;fields[fieldName]={read:ptr=>getterReturnType["fromWireType"](getter(getterContext,ptr)),write:(ptr,o)=>{var destructors=[];setter(setterContext,ptr,setterArgumentType["toWireType"](destructors,o));runDestructors(destructors)}}});return[{name:reg.name,"fromWireType":ptr=>{var rv={};for(var i in fields){rv[i]=fields[i].read(ptr)}rawDestructor(ptr);return rv},"toWireType":(destructors,o)=>{for(var fieldName in fields){if(!(fieldName in o)){throw new TypeError(`Missing field: "${fieldName}"`)}}var ptr=rawConstructor();for(fieldName in fields){fields[fieldName].write(ptr,o[fieldName])}if(destructors!==null){destructors.push(rawDestructor,ptr)}return ptr},"argPackAdvance":GenericWireTypeSize,"readValueFromPointer":simpleReadValueFromPointer,destructorFunction:rawDestructor}]})};var __embind_register_bigint=(primitiveType,name,size,minRange,maxRange)=>{};var embind_init_charCodes=()=>{var codes=new Array(256);for(var i=0;i<256;++i){codes[i]=String.fromCharCode(i)}embind_charCodes=codes};var embind_charCodes=undefined;var readLatin1String=ptr=>{var ret="";var c=ptr;while(HEAPU8[c]){ret+=embind_charCodes[HEAPU8[c++]]}return ret};var BindingError=undefined;var throwBindingError=message=>{throw new BindingError(message)};function sharedRegisterType(rawType,registeredInstance,options={}){var name=registeredInstance.name;if(!rawType){throwBindingError(`type "${name}" must have a positive integer typeid pointer`)}if(registeredTypes.hasOwnProperty(rawType)){if(options.ignoreDuplicateRegistrations){return}else{throwBindingError(`Cannot register type '${name}' twice`)}}registeredTypes[rawType]=registeredInstance;delete typeDependencies[rawType];if(awaitingDependencies.hasOwnProperty(rawType)){var callbacks=awaitingDependencies[rawType];delete awaitingDependencies[rawType];callbacks.forEach(cb=>cb())}}function registerType(rawType,registeredInstance,options={}){if(!("argPackAdvance"in registeredInstance)){throw new TypeError("registerType registeredInstance requires argPackAdvance")}return sharedRegisterType(rawType,registeredInstance,options)}var GenericWireTypeSize=8;var __embind_register_bool=(rawType,name,trueValue,falseValue)=>{name=readLatin1String(name);registerType(rawType,{name:name,"fromWireType":function(wt){return!!wt},"toWireType":function(destructors,o){return o?trueValue:falseValue},"argPackAdvance":GenericWireTypeSize,"readValueFromPointer":function(pointer){return this["fromWireType"](HEAPU8[pointer])},destructorFunction:null})};function ClassHandle_isAliasOf(other){if(!(this instanceof ClassHandle)){return false}if(!(other instanceof ClassHandle)){return false}var leftClass=this.$$.ptrType.registeredClass;var left=this.$$.ptr;var rightClass=other.$$.ptrType.registeredClass;var right=other.$$.ptr;while(leftClass.baseClass){left=leftClass.upcast(left);leftClass=leftClass.baseClass}while(rightClass.baseClass){right=rightClass.upcast(right);rightClass=rightClass.baseClass}return leftClass===rightClass&&left===right}var shallowCopyInternalPointer=o=>({count:o.count,deleteScheduled:o.deleteScheduled,preservePointerOnDelete:o.preservePointerOnDelete,ptr:o.ptr,ptrType:o.ptrType,smartPtr:o.smartPtr,smartPtrType:o.smartPtrType});var throwInstanceAlreadyDeleted=obj=>{function getInstanceTypeName(handle){return handle.$$.ptrType.registeredClass.name}throwBindingError(getInstanceTypeName(obj)+" instance already deleted")};var finalizationRegistry=false;var detachFinalizer=handle=>{};var runDestructor=$$=>{if($$.smartPtr){$$.smartPtrType.rawDestructor($$.smartPtr)}else{$$.ptrType.registeredClass.rawDestructor($$.ptr)}};var releaseClassHandle=$$=>{$$.count.value-=1;var toDelete=0===$$.count.value;if(toDelete){runDestructor($$)}};var downcastPointer=(ptr,ptrClass,desiredClass)=>{if(ptrClass===desiredClass){return ptr}if(undefined===desiredClass.baseClass){return null}var rv=downcastPointer(ptr,ptrClass,desiredClass.baseClass);if(rv===null){return null}return desiredClass.downcast(rv)};var registeredPointers={};var getInheritedInstanceCount=()=>Object.keys(registeredInstances).length;var getLiveInheritedInstances=()=>{var rv=[];for(var k in registeredInstances){if(registeredInstances.hasOwnProperty(k)){rv.push(registeredInstances[k])}}return rv};var deletionQueue=[];var flushPendingDeletes=()=>{while(deletionQueue.length){var obj=deletionQueue.pop();obj.$$.deleteScheduled=false;obj["delete"]()}};var delayFunction=undefined;var setDelayFunction=fn=>{delayFunction=fn;if(deletionQueue.length&&delayFunction){delayFunction(flushPendingDeletes)}};var init_embind=()=>{Module["getInheritedInstanceCount"]=getInheritedInstanceCount;Module["getLiveInheritedInstances"]=getLiveInheritedInstances;Module["flushPendingDeletes"]=flushPendingDeletes;Module["setDelayFunction"]=setDelayFunction};var registeredInstances={};var getBasestPointer=(class_,ptr)=>{if(ptr===undefined){throwBindingError("ptr should not be undefined")}while(class_.baseClass){ptr=class_.upcast(ptr);class_=class_.baseClass}return ptr};var getInheritedInstance=(class_,ptr)=>{ptr=getBasestPointer(class_,ptr);return registeredInstances[ptr]};var makeClassHandle=(prototype,record)=>{if(!record.ptrType||!record.ptr){throwInternalError("makeClassHandle requires ptr and ptrType")}var hasSmartPtrType=!!record.smartPtrType;var hasSmartPtr=!!record.smartPtr;if(hasSmartPtrType!==hasSmartPtr){throwInternalError("Both smartPtrType and smartPtr must be specified")}record.count={value:1};return attachFinalizer(Object.create(prototype,{$$:{value:record}}))};function RegisteredPointer_fromWireType(ptr){var rawPointer=this.getPointee(ptr);if(!rawPointer){this.destructor(ptr);return null}var registeredInstance=getInheritedInstance(this.registeredClass,rawPointer);if(undefined!==registeredInstance){if(0===registeredInstance.$$.count.value){registeredInstance.$$.ptr=rawPointer;registeredInstance.$$.smartPtr=ptr;return registeredInstance["clone"]()}else{var rv=registeredInstance["clone"]();this.destructor(ptr);return rv}}function makeDefaultHandle(){if(this.isSmartPointer){return makeClassHandle(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:rawPointer,smartPtrType:this,smartPtr:ptr})}else{return makeClassHandle(this.registeredClass.instancePrototype,{ptrType:this,ptr:ptr})}}var actualType=this.registeredClass.getActualType(rawPointer);var registeredPointerRecord=registeredPointers[actualType];if(!registeredPointerRecord){return makeDefaultHandle.call(this)}var toType;if(this.isConst){toType=registeredPointerRecord.constPointerType}else{toType=registeredPointerRecord.pointerType}var dp=downcastPointer(rawPointer,this.registeredClass,toType.registeredClass);if(dp===null){return makeDefaultHandle.call(this)}if(this.isSmartPointer){return makeClassHandle(toType.registeredClass.instancePrototype,{ptrType:toType,ptr:dp,smartPtrType:this,smartPtr:ptr})}else{return makeClassHandle(toType.registeredClass.instancePrototype,{ptrType:toType,ptr:dp})}}var attachFinalizer=handle=>{if("undefined"===typeof FinalizationRegistry){attachFinalizer=handle=>handle;return handle}finalizationRegistry=new FinalizationRegistry(info=>{releaseClassHandle(info.$$)});attachFinalizer=handle=>{var $$=handle.$$;var hasSmartPtr=!!$$.smartPtr;if(hasSmartPtr){var info={$$:$$};finalizationRegistry.register(handle,info,handle)}return handle};detachFinalizer=handle=>finalizationRegistry.unregister(handle);return attachFinalizer(handle)};function ClassHandle_clone(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this)}if(this.$$.preservePointerOnDelete){this.$$.count.value+=1;return this}else{var clone=attachFinalizer(Object.create(Object.getPrototypeOf(this),{$$:{value:shallowCopyInternalPointer(this.$$)}}));clone.$$.count.value+=1;clone.$$.deleteScheduled=false;return clone}}function ClassHandle_delete(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this)}if(this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete){throwBindingError("Object already scheduled for deletion")}detachFinalizer(this);releaseClassHandle(this.$$);if(!this.$$.preservePointerOnDelete){this.$$.smartPtr=undefined;this.$$.ptr=undefined}}function ClassHandle_isDeleted(){return!this.$$.ptr}function ClassHandle_deleteLater(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this)}if(this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete){throwBindingError("Object already scheduled for deletion")}deletionQueue.push(this);if(deletionQueue.length===1&&delayFunction){delayFunction(flushPendingDeletes)}this.$$.deleteScheduled=true;return this}var init_ClassHandle=()=>{ClassHandle.prototype["isAliasOf"]=ClassHandle_isAliasOf;ClassHandle.prototype["clone"]=ClassHandle_clone;ClassHandle.prototype["delete"]=ClassHandle_delete;ClassHandle.prototype["isDeleted"]=ClassHandle_isDeleted;ClassHandle.prototype["deleteLater"]=ClassHandle_deleteLater};function ClassHandle(){}var char_0=48;var char_9=57;var makeLegalFunctionName=name=>{if(undefined===name){return"_unknown"}name=name.replace(/[^a-zA-Z0-9_]/g,"$");var f=name.charCodeAt(0);if(f>=char_0&&f<=char_9){return`_${name}`}return name};function createNamedFunction(name,body){name=makeLegalFunctionName(name);return{[name]:function(){return body.apply(this,arguments)}}[name]}var ensureOverloadTable=(proto,methodName,humanName)=>{if(undefined===proto[methodName].overloadTable){var prevFunc=proto[methodName];proto[methodName]=function(){if(!proto[methodName].overloadTable.hasOwnProperty(arguments.length)){throwBindingError(`Function '${humanName}' called with an invalid number of arguments (${arguments.length}) - expects one of (${proto[methodName].overloadTable})!`)}return proto[methodName].overloadTable[arguments.length].apply(this,arguments)};proto[methodName].overloadTable=[];proto[methodName].overloadTable[prevFunc.argCount]=prevFunc}};var exposePublicSymbol=(name,value,numArguments)=>{if(Module.hasOwnProperty(name)){if(undefined===numArguments||undefined!==Module[name].overloadTable&&undefined!==Module[name].overloadTable[numArguments]){throwBindingError(`Cannot register public name '${name}' twice`)}ensureOverloadTable(Module,name,name);if(Module.hasOwnProperty(numArguments)){throwBindingError(`Cannot register multiple overloads of a function with the same number of arguments (${numArguments})!`)}Module[name].overloadTable[numArguments]=value}else{Module[name]=value;if(undefined!==numArguments){Module[name].numArguments=numArguments}}};function RegisteredClass(name,constructor,instancePrototype,rawDestructor,baseClass,getActualType,upcast,downcast){this.name=name;this.constructor=constructor;this.instancePrototype=instancePrototype;this.rawDestructor=rawDestructor;this.baseClass=baseClass;this.getActualType=getActualType;this.upcast=upcast;this.downcast=downcast;this.pureVirtualFunctions=[]}var upcastPointer=(ptr,ptrClass,desiredClass)=>{while(ptrClass!==desiredClass){if(!ptrClass.upcast){throwBindingError(`Expected null or instance of ${desiredClass.name}, got an instance of ${ptrClass.name}`)}ptr=ptrClass.upcast(ptr);ptrClass=ptrClass.baseClass}return ptr};function constNoSmartPtrRawPointerToWireType(destructors,handle){if(handle===null){if(this.isReference){throwBindingError(`null is not a valid ${this.name}`)}return 0}if(!handle.$$){throwBindingError(`Cannot pass "${embindRepr(handle)}" as a ${this.name}`)}if(!handle.$$.ptr){throwBindingError(`Cannot pass deleted object as a pointer of type ${this.name}`)}var handleClass=handle.$$.ptrType.registeredClass;var ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);return ptr}function genericPointerToWireType(destructors,handle){var ptr;if(handle===null){if(this.isReference){throwBindingError(`null is not a valid ${this.name}`)}if(this.isSmartPointer){ptr=this.rawConstructor();if(destructors!==null){destructors.push(this.rawDestructor,ptr)}return ptr}else{return 0}}if(!handle.$$){throwBindingError(`Cannot pass "${embindRepr(handle)}" as a ${this.name}`)}if(!handle.$$.ptr){throwBindingError(`Cannot pass deleted object as a pointer of type ${this.name}`)}if(!this.isConst&&handle.$$.ptrType.isConst){throwBindingError(`Cannot convert argument of type ${handle.$$.smartPtrType?handle.$$.smartPtrType.name:handle.$$.ptrType.name} to parameter type ${this.name}`)}var handleClass=handle.$$.ptrType.registeredClass;ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);if(this.isSmartPointer){if(undefined===handle.$$.smartPtr){throwBindingError("Passing raw pointer to smart pointer is illegal")}switch(this.sharingPolicy){case 0:if(handle.$$.smartPtrType===this){ptr=handle.$$.smartPtr}else{throwBindingError(`Cannot convert argument of type ${handle.$$.smartPtrType?handle.$$.smartPtrType.name:handle.$$.ptrType.name} to parameter type ${this.name}`)}break;case 1:ptr=handle.$$.smartPtr;break;case 2:if(handle.$$.smartPtrType===this){ptr=handle.$$.smartPtr}else{var clonedHandle=handle["clone"]();ptr=this.rawShare(ptr,Emval.toHandle(()=>clonedHandle["delete"]()));if(destructors!==null){destructors.push(this.rawDestructor,ptr)}}break;default:throwBindingError("Unsupporting sharing policy")}}return ptr}function nonConstNoSmartPtrRawPointerToWireType(destructors,handle){if(handle===null){if(this.isReference){throwBindingError(`null is not a valid ${this.name}`)}return 0}if(!handle.$$){throwBindingError(`Cannot pass "${embindRepr(handle)}" as a ${this.name}`)}if(!handle.$$.ptr){throwBindingError(`Cannot pass deleted object as a pointer of type ${this.name}`)}if(handle.$$.ptrType.isConst){throwBindingError(`Cannot convert argument of type ${handle.$$.ptrType.name} to parameter type ${this.name}`)}var handleClass=handle.$$.ptrType.registeredClass;var ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);return ptr}function readPointer(pointer){return this["fromWireType"](HEAPU32[pointer>>2])}function RegisteredPointer_getPointee(ptr){if(this.rawGetPointee){ptr=this.rawGetPointee(ptr)}return ptr}function RegisteredPointer_destructor(ptr){if(this.rawDestructor){this.rawDestructor(ptr)}}var RegisteredPointer_deleteObject=handle=>{if(handle!==null){handle["delete"]()}};var init_RegisteredPointer=()=>{RegisteredPointer.prototype.getPointee=RegisteredPointer_getPointee;RegisteredPointer.prototype.destructor=RegisteredPointer_destructor;RegisteredPointer.prototype["argPackAdvance"]=GenericWireTypeSize;RegisteredPointer.prototype["readValueFromPointer"]=readPointer;RegisteredPointer.prototype["deleteObject"]=RegisteredPointer_deleteObject;RegisteredPointer.prototype["fromWireType"]=RegisteredPointer_fromWireType};function RegisteredPointer(name,registeredClass,isReference,isConst,isSmartPointer,pointeeType,sharingPolicy,rawGetPointee,rawConstructor,rawShare,rawDestructor){this.name=name;this.registeredClass=registeredClass;this.isReference=isReference;this.isConst=isConst;this.isSmartPointer=isSmartPointer;this.pointeeType=pointeeType;this.sharingPolicy=sharingPolicy;this.rawGetPointee=rawGetPointee;this.rawConstructor=rawConstructor;this.rawShare=rawShare;this.rawDestructor=rawDestructor;if(!isSmartPointer&®isteredClass.baseClass===undefined){if(isConst){this["toWireType"]=constNoSmartPtrRawPointerToWireType;this.destructorFunction=null}else{this["toWireType"]=nonConstNoSmartPtrRawPointerToWireType;this.destructorFunction=null}}else{this["toWireType"]=genericPointerToWireType}}var replacePublicSymbol=(name,value,numArguments)=>{if(!Module.hasOwnProperty(name)){throwInternalError("Replacing nonexistant public symbol")}if(undefined!==Module[name].overloadTable&&undefined!==numArguments){Module[name].overloadTable[numArguments]=value}else{Module[name]=value;Module[name].argCount=numArguments}};var dynCallLegacy=(sig,ptr,args)=>{var f=Module["dynCall_"+sig];return args&&args.length?f.apply(null,[ptr].concat(args)):f.call(null,ptr)};var wasmTableMirror=[];var getWasmTableEntry=funcPtr=>{var func=wasmTableMirror[funcPtr];if(!func){if(funcPtr>=wasmTableMirror.length)wasmTableMirror.length=funcPtr+1;wasmTableMirror[funcPtr]=func=wasmTable.get(funcPtr)}return func};var dynCall=(sig,ptr,args)=>{if(sig.includes("j")){return dynCallLegacy(sig,ptr,args)}var rtn=getWasmTableEntry(ptr).apply(null,args);return rtn};var getDynCaller=(sig,ptr)=>{var argCache=[];return function(){argCache.length=0;Object.assign(argCache,arguments);return dynCall(sig,ptr,argCache)}};var embind__requireFunction=(signature,rawFunction)=>{signature=readLatin1String(signature);function makeDynCaller(){if(signature.includes("j")){return getDynCaller(signature,rawFunction)}return getWasmTableEntry(rawFunction)}var fp=makeDynCaller();if(typeof fp!="function"){throwBindingError(`unknown function pointer with signature ${signature}: ${rawFunction}`)}return fp};var extendError=(baseErrorType,errorName)=>{var errorClass=createNamedFunction(errorName,function(message){this.name=errorName;this.message=message;var stack=new Error(message).stack;if(stack!==undefined){this.stack=this.toString()+"\n"+stack.replace(/^Error(:[^\n]*)?\n/,"")}});errorClass.prototype=Object.create(baseErrorType.prototype);errorClass.prototype.constructor=errorClass;errorClass.prototype.toString=function(){if(this.message===undefined){return this.name}else{return`${this.name}: ${this.message}`}};return errorClass};var UnboundTypeError=undefined;var getTypeName=type=>{var ptr=___getTypeName(type);var rv=readLatin1String(ptr);_free(ptr);return rv};var throwUnboundTypeError=(message,types)=>{var unboundTypes=[];var seen={};function visit(type){if(seen[type]){return}if(registeredTypes[type]){return}if(typeDependencies[type]){typeDependencies[type].forEach(visit);return}unboundTypes.push(type);seen[type]=true}types.forEach(visit);throw new UnboundTypeError(`${message}: `+unboundTypes.map(getTypeName).join([", "]))};var __embind_register_class=(rawType,rawPointerType,rawConstPointerType,baseClassRawType,getActualTypeSignature,getActualType,upcastSignature,upcast,downcastSignature,downcast,name,destructorSignature,rawDestructor)=>{name=readLatin1String(name);getActualType=embind__requireFunction(getActualTypeSignature,getActualType);if(upcast){upcast=embind__requireFunction(upcastSignature,upcast)}if(downcast){downcast=embind__requireFunction(downcastSignature,downcast)}rawDestructor=embind__requireFunction(destructorSignature,rawDestructor);var legalFunctionName=makeLegalFunctionName(name);exposePublicSymbol(legalFunctionName,function(){throwUnboundTypeError(`Cannot construct ${name} due to unbound types`,[baseClassRawType])});whenDependentTypesAreResolved([rawType,rawPointerType,rawConstPointerType],baseClassRawType?[baseClassRawType]:[],function(base){base=base[0];var baseClass;var basePrototype;if(baseClassRawType){baseClass=base.registeredClass;basePrototype=baseClass.instancePrototype}else{basePrototype=ClassHandle.prototype}var constructor=createNamedFunction(legalFunctionName,function(){if(Object.getPrototypeOf(this)!==instancePrototype){throw new BindingError("Use 'new' to construct "+name)}if(undefined===registeredClass.constructor_body){throw new BindingError(name+" has no accessible constructor")}var body=registeredClass.constructor_body[arguments.length];if(undefined===body){throw new BindingError(`Tried to invoke ctor of ${name} with invalid number of parameters (${arguments.length}) - expected (${Object.keys(registeredClass.constructor_body).toString()}) parameters instead!`)}return body.apply(this,arguments)});var instancePrototype=Object.create(basePrototype,{constructor:{value:constructor}});constructor.prototype=instancePrototype;var registeredClass=new RegisteredClass(name,constructor,instancePrototype,rawDestructor,baseClass,getActualType,upcast,downcast);if(registeredClass.baseClass){if(registeredClass.baseClass.__derivedClasses===undefined){registeredClass.baseClass.__derivedClasses=[]}registeredClass.baseClass.__derivedClasses.push(registeredClass)}var referenceConverter=new RegisteredPointer(name,registeredClass,true,false,false);var pointerConverter=new RegisteredPointer(name+"*",registeredClass,false,false,false);var constPointerConverter=new RegisteredPointer(name+" const*",registeredClass,false,true,false);registeredPointers[rawType]={pointerType:pointerConverter,constPointerType:constPointerConverter};replacePublicSymbol(legalFunctionName,constructor);return[referenceConverter,pointerConverter,constPointerConverter]})};var heap32VectorToArray=(count,firstElement)=>{var array=[];for(var i=0;i>2])}return array};function newFunc(constructor,argumentList){if(!(constructor instanceof Function)){throw new TypeError(`new_ called with constructor type ${typeof constructor} which is not a function`)}var dummy=createNamedFunction(constructor.name||"unknownFunctionName",function(){});dummy.prototype=constructor.prototype;var obj=new dummy;var r=constructor.apply(obj,argumentList);return r instanceof Object?r:obj}function craftInvokerFunction(humanName,argTypes,classType,cppInvokerFunc,cppTargetFunc,isAsync){var argCount=argTypes.length;if(argCount<2){throwBindingError("argTypes array size mismatch! Must at least get return value and 'this' types!")}var isClassMethodFunc=argTypes[1]!==null&&classType!==null;var needsDestructorStack=false;for(var i=1;i0?", ":"")+argsListWired}invokerFnBody+=(returns||isAsync?"var rv = ":"")+"invoker(fn"+(argsListWired.length>0?", ":"")+argsListWired+");\n";if(needsDestructorStack){invokerFnBody+="runDestructors(destructors);\n"}else{for(var i=isClassMethodFunc?1:2;i{var rawArgTypes=heap32VectorToArray(argCount,rawArgTypesAddr);invoker=embind__requireFunction(invokerSignature,invoker);whenDependentTypesAreResolved([],[rawClassType],function(classType){classType=classType[0];var humanName=`constructor ${classType.name}`;if(undefined===classType.registeredClass.constructor_body){classType.registeredClass.constructor_body=[]}if(undefined!==classType.registeredClass.constructor_body[argCount-1]){throw new BindingError(`Cannot register multiple constructors with identical number of parameters (${argCount-1}) for class '${classType.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`)}classType.registeredClass.constructor_body[argCount-1]=()=>{throwUnboundTypeError(`Cannot construct ${classType.name} due to unbound types`,rawArgTypes)};whenDependentTypesAreResolved([],rawArgTypes,argTypes=>{argTypes.splice(1,0,null);classType.registeredClass.constructor_body[argCount-1]=craftInvokerFunction(humanName,argTypes,null,invoker,rawConstructor);return[]});return[]})};var __embind_register_class_function=(rawClassType,methodName,argCount,rawArgTypesAddr,invokerSignature,rawInvoker,context,isPureVirtual,isAsync)=>{var rawArgTypes=heap32VectorToArray(argCount,rawArgTypesAddr);methodName=readLatin1String(methodName);rawInvoker=embind__requireFunction(invokerSignature,rawInvoker);whenDependentTypesAreResolved([],[rawClassType],function(classType){classType=classType[0];var humanName=`${classType.name}.${methodName}`;if(methodName.startsWith("@@")){methodName=Symbol[methodName.substring(2)]}if(isPureVirtual){classType.registeredClass.pureVirtualFunctions.push(methodName)}function unboundTypesHandler(){throwUnboundTypeError(`Cannot call ${humanName} due to unbound types`,rawArgTypes)}var proto=classType.registeredClass.instancePrototype;var method=proto[methodName];if(undefined===method||undefined===method.overloadTable&&method.className!==classType.name&&method.argCount===argCount-2){unboundTypesHandler.argCount=argCount-2;unboundTypesHandler.className=classType.name;proto[methodName]=unboundTypesHandler}else{ensureOverloadTable(proto,methodName,humanName);proto[methodName].overloadTable[argCount-2]=unboundTypesHandler}whenDependentTypesAreResolved([],rawArgTypes,function(argTypes){var memberFunction=craftInvokerFunction(humanName,argTypes,classType,rawInvoker,context,isAsync);if(undefined===proto[methodName].overloadTable){memberFunction.argCount=argCount-2;proto[methodName]=memberFunction}else{proto[methodName].overloadTable[argCount-2]=memberFunction}return[]});return[]})};function handleAllocatorInit(){Object.assign(HandleAllocator.prototype,{get(id){return this.allocated[id]},has(id){return this.allocated[id]!==undefined},allocate(handle){var id=this.freelist.pop()||this.allocated.length;this.allocated[id]=handle;return id},free(id){this.allocated[id]=undefined;this.freelist.push(id)}})}function HandleAllocator(){this.allocated=[undefined];this.freelist=[]}var emval_handles=new HandleAllocator;var __emval_decref=handle=>{if(handle>=emval_handles.reserved&&0===--emval_handles.get(handle).refcount){emval_handles.free(handle)}};var count_emval_handles=()=>{var count=0;for(var i=emval_handles.reserved;i{emval_handles.allocated.push({value:undefined},{value:null},{value:true},{value:false});emval_handles.reserved=emval_handles.allocated.length;Module["count_emval_handles"]=count_emval_handles};var Emval={toValue:handle=>{if(!handle){throwBindingError("Cannot use deleted val. handle = "+handle)}return emval_handles.get(handle).value},toHandle:value=>{switch(value){case undefined:return 1;case null:return 2;case true:return 3;case false:return 4;default:{return emval_handles.allocate({refcount:1,value:value})}}}};var __embind_register_emval=(rawType,name)=>{name=readLatin1String(name);registerType(rawType,{name:name,"fromWireType":handle=>{var rv=Emval.toValue(handle);__emval_decref(handle);return rv},"toWireType":(destructors,value)=>Emval.toHandle(value),"argPackAdvance":GenericWireTypeSize,"readValueFromPointer":simpleReadValueFromPointer,destructorFunction:null})};var enumReadValueFromPointer=(name,width,signed)=>{switch(width){case 1:return signed?function(pointer){return this["fromWireType"](HEAP8[pointer>>0])}:function(pointer){return this["fromWireType"](HEAPU8[pointer>>0])};case 2:return signed?function(pointer){return this["fromWireType"](HEAP16[pointer>>1])}:function(pointer){return this["fromWireType"](HEAPU16[pointer>>1])};case 4:return signed?function(pointer){return this["fromWireType"](HEAP32[pointer>>2])}:function(pointer){return this["fromWireType"](HEAPU32[pointer>>2])};default:throw new TypeError(`invalid integer width (${width}): ${name}`)}};var __embind_register_enum=(rawType,name,size,isSigned)=>{name=readLatin1String(name);function ctor(){}ctor.values={};registerType(rawType,{name:name,constructor:ctor,"fromWireType":function(c){return this.constructor.values[c]},"toWireType":(destructors,c)=>c.value,"argPackAdvance":GenericWireTypeSize,"readValueFromPointer":enumReadValueFromPointer(name,size,isSigned),destructorFunction:null});exposePublicSymbol(name,ctor)};var requireRegisteredType=(rawType,humanName)=>{var impl=registeredTypes[rawType];if(undefined===impl){throwBindingError(humanName+" has unknown type "+getTypeName(rawType))}return impl};var __embind_register_enum_value=(rawEnumType,name,enumValue)=>{var enumType=requireRegisteredType(rawEnumType,"enum");name=readLatin1String(name);var Enum=enumType.constructor;var Value=Object.create(enumType.constructor.prototype,{value:{value:enumValue},constructor:{value:createNamedFunction(`${enumType.name}_${name}`,function(){})}});Enum.values[enumValue]=Value;Enum[name]=Value};var embindRepr=v=>{if(v===null){return"null"}var t=typeof v;if(t==="object"||t==="array"||t==="function"){return v.toString()}else{return""+v}};var floatReadValueFromPointer=(name,width)=>{switch(width){case 4:return function(pointer){return this["fromWireType"](HEAPF32[pointer>>2])};case 8:return function(pointer){return this["fromWireType"](HEAPF64[pointer>>3])};default:throw new TypeError(`invalid float width (${width}): ${name}`)}};var __embind_register_float=(rawType,name,size)=>{name=readLatin1String(name);registerType(rawType,{name:name,"fromWireType":value=>value,"toWireType":(destructors,value)=>value,"argPackAdvance":GenericWireTypeSize,"readValueFromPointer":floatReadValueFromPointer(name,size),destructorFunction:null})};var __embind_register_function=(name,argCount,rawArgTypesAddr,signature,rawInvoker,fn,isAsync)=>{var argTypes=heap32VectorToArray(argCount,rawArgTypesAddr);name=readLatin1String(name);rawInvoker=embind__requireFunction(signature,rawInvoker);exposePublicSymbol(name,function(){throwUnboundTypeError(`Cannot call ${name} due to unbound types`,argTypes)},argCount-1);whenDependentTypesAreResolved([],argTypes,function(argTypes){var invokerArgsArray=[argTypes[0],null].concat(argTypes.slice(1));replacePublicSymbol(name,craftInvokerFunction(name,invokerArgsArray,null,rawInvoker,fn,isAsync),argCount-1);return[]})};var integerReadValueFromPointer=(name,width,signed)=>{switch(width){case 1:return signed?pointer=>HEAP8[pointer>>0]:pointer=>HEAPU8[pointer>>0];case 2:return signed?pointer=>HEAP16[pointer>>1]:pointer=>HEAPU16[pointer>>1];case 4:return signed?pointer=>HEAP32[pointer>>2]:pointer=>HEAPU32[pointer>>2];default:throw new TypeError(`invalid integer width (${width}): ${name}`)}};var __embind_register_integer=(primitiveType,name,size,minRange,maxRange)=>{name=readLatin1String(name);if(maxRange===-1){maxRange=4294967295}var fromWireType=value=>value;if(minRange===0){var bitshift=32-8*size;fromWireType=value=>value<>>bitshift}var isUnsignedType=name.includes("unsigned");var checkAssertions=(value,toTypeName)=>{};var toWireType;if(isUnsignedType){toWireType=function(destructors,value){checkAssertions(value,this.name);return value>>>0}}else{toWireType=function(destructors,value){checkAssertions(value,this.name);return value}}registerType(primitiveType,{name:name,"fromWireType":fromWireType,"toWireType":toWireType,"argPackAdvance":GenericWireTypeSize,"readValueFromPointer":integerReadValueFromPointer(name,size,minRange!==0),destructorFunction:null})};var __embind_register_memory_view=(rawType,dataTypeIndex,name)=>{var typeMapping=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];var TA=typeMapping[dataTypeIndex];function decodeMemoryView(handle){var size=HEAPU32[handle>>2];var data=HEAPU32[handle+4>>2];return new TA(HEAP8.buffer,data,size)}name=readLatin1String(name);registerType(rawType,{name:name,"fromWireType":decodeMemoryView,"argPackAdvance":GenericWireTypeSize,"readValueFromPointer":decodeMemoryView},{ignoreDuplicateRegistrations:true})};var stringToUTF8Array=(str,heap,outIdx,maxBytesToWrite)=>{if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx};var stringToUTF8=(str,outPtr,maxBytesToWrite)=>stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite);var lengthBytesUTF8=str=>{var len=0;for(var i=0;i=55296&&c<=57343){len+=4;++i}else{len+=3}}return len};var UTF8Decoder=typeof TextDecoder!="undefined"?new TextDecoder("utf8"):undefined;var UTF8ArrayToString=(heapOrArray,idx,maxBytesToRead)=>{var endIdx=idx+maxBytesToRead;var endPtr=idx;while(heapOrArray[endPtr]&&!(endPtr>=endIdx))++endPtr;if(endPtr-idx>16&&heapOrArray.buffer&&UTF8Decoder){return UTF8Decoder.decode(heapOrArray.subarray(idx,endPtr))}var str="";while(idx>10,56320|ch&1023)}}return str};var UTF8ToString=(ptr,maxBytesToRead)=>ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):"";var __embind_register_std_string=(rawType,name)=>{name=readLatin1String(name);var stdStringIsUTF8=name==="std::string";registerType(rawType,{name:name,"fromWireType":value=>{var length=HEAPU32[value>>2];var payload=value+4;var str;if(stdStringIsUTF8){var decodeStartPtr=payload;for(var i=0;i<=length;++i){var currentBytePtr=payload+i;if(i==length||HEAPU8[currentBytePtr]==0){var maxRead=currentBytePtr-decodeStartPtr;var stringSegment=UTF8ToString(decodeStartPtr,maxRead);if(str===undefined){str=stringSegment}else{str+=String.fromCharCode(0);str+=stringSegment}decodeStartPtr=currentBytePtr+1}}}else{var a=new Array(length);for(var i=0;i{if(value instanceof ArrayBuffer){value=new Uint8Array(value)}var length;var valueIsOfTypeString=typeof value=="string";if(!(valueIsOfTypeString||value instanceof Uint8Array||value instanceof Uint8ClampedArray||value instanceof Int8Array)){throwBindingError("Cannot pass non-string to std::string")}if(stdStringIsUTF8&&valueIsOfTypeString){length=lengthBytesUTF8(value)}else{length=value.length}var base=_malloc(4+length+1);var ptr=base+4;HEAPU32[base>>2]=length;if(stdStringIsUTF8&&valueIsOfTypeString){stringToUTF8(value,ptr,length+1)}else{if(valueIsOfTypeString){for(var i=0;i255){_free(ptr);throwBindingError("String has UTF-16 code units that do not fit in 8 bits")}HEAPU8[ptr+i]=charCode}}else{for(var i=0;i_free(ptr)})};var UTF16Decoder=typeof TextDecoder!="undefined"?new TextDecoder("utf-16le"):undefined;var UTF16ToString=(ptr,maxBytesToRead)=>{var endPtr=ptr;var idx=endPtr>>1;var maxIdx=idx+maxBytesToRead/2;while(!(idx>=maxIdx)&&HEAPU16[idx])++idx;endPtr=idx<<1;if(endPtr-ptr>32&&UTF16Decoder)return UTF16Decoder.decode(HEAPU8.subarray(ptr,endPtr));var str="";for(var i=0;!(i>=maxBytesToRead/2);++i){var codeUnit=HEAP16[ptr+i*2>>1];if(codeUnit==0)break;str+=String.fromCharCode(codeUnit)}return str};var stringToUTF16=(str,outPtr,maxBytesToWrite)=>{if(maxBytesToWrite===undefined){maxBytesToWrite=2147483647}if(maxBytesToWrite<2)return 0;maxBytesToWrite-=2;var startPtr=outPtr;var numCharsToWrite=maxBytesToWrite>1]=codeUnit;outPtr+=2}HEAP16[outPtr>>1]=0;return outPtr-startPtr};var lengthBytesUTF16=str=>str.length*2;var UTF32ToString=(ptr,maxBytesToRead)=>{var i=0;var str="";while(!(i>=maxBytesToRead/4)){var utf32=HEAP32[ptr+i*4>>2];if(utf32==0)break;++i;if(utf32>=65536){var ch=utf32-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}else{str+=String.fromCharCode(utf32)}}return str};var stringToUTF32=(str,outPtr,maxBytesToWrite)=>{if(maxBytesToWrite===undefined){maxBytesToWrite=2147483647}if(maxBytesToWrite<4)return 0;var startPtr=outPtr;var endPtr=startPtr+maxBytesToWrite-4;for(var i=0;i=55296&&codeUnit<=57343){var trailSurrogate=str.charCodeAt(++i);codeUnit=65536+((codeUnit&1023)<<10)|trailSurrogate&1023}HEAP32[outPtr>>2]=codeUnit;outPtr+=4;if(outPtr+4>endPtr)break}HEAP32[outPtr>>2]=0;return outPtr-startPtr};var lengthBytesUTF32=str=>{var len=0;for(var i=0;i=55296&&codeUnit<=57343)++i;len+=4}return len};var __embind_register_std_wstring=(rawType,charSize,name)=>{name=readLatin1String(name);var decodeString,encodeString,getHeap,lengthBytesUTF,shift;if(charSize===2){decodeString=UTF16ToString;encodeString=stringToUTF16;lengthBytesUTF=lengthBytesUTF16;getHeap=()=>HEAPU16;shift=1}else if(charSize===4){decodeString=UTF32ToString;encodeString=stringToUTF32;lengthBytesUTF=lengthBytesUTF32;getHeap=()=>HEAPU32;shift=2}registerType(rawType,{name:name,"fromWireType":value=>{var length=HEAPU32[value>>2];var HEAP=getHeap();var str;var decodeStartPtr=value+4;for(var i=0;i<=length;++i){var currentBytePtr=value+4+i*charSize;if(i==length||HEAP[currentBytePtr>>shift]==0){var maxReadBytes=currentBytePtr-decodeStartPtr;var stringSegment=decodeString(decodeStartPtr,maxReadBytes);if(str===undefined){str=stringSegment}else{str+=String.fromCharCode(0);str+=stringSegment}decodeStartPtr=currentBytePtr+charSize}}_free(value);return str},"toWireType":(destructors,value)=>{if(!(typeof value=="string")){throwBindingError(`Cannot pass non-string to C++ string type ${name}`)}var length=lengthBytesUTF(value);var ptr=_malloc(4+length+charSize);HEAPU32[ptr>>2]=length>>shift;encodeString(value,ptr+4,length+charSize);if(destructors!==null){destructors.push(_free,ptr)}return ptr},"argPackAdvance":GenericWireTypeSize,"readValueFromPointer":simpleReadValueFromPointer,destructorFunction:ptr=>_free(ptr)})};var __embind_register_value_object=(rawType,name,constructorSignature,rawConstructor,destructorSignature,rawDestructor)=>{structRegistrations[rawType]={name:readLatin1String(name),rawConstructor:embind__requireFunction(constructorSignature,rawConstructor),rawDestructor:embind__requireFunction(destructorSignature,rawDestructor),fields:[]}};var __embind_register_value_object_field=(structType,fieldName,getterReturnType,getterSignature,getter,getterContext,setterArgumentType,setterSignature,setter,setterContext)=>{structRegistrations[structType].fields.push({fieldName:readLatin1String(fieldName),getterReturnType:getterReturnType,getter:embind__requireFunction(getterSignature,getter),getterContext:getterContext,setterArgumentType:setterArgumentType,setter:embind__requireFunction(setterSignature,setter),setterContext:setterContext})};var __embind_register_void=(rawType,name)=>{name=readLatin1String(name);registerType(rawType,{isVoid:true,name:name,"argPackAdvance":0,"fromWireType":()=>undefined,"toWireType":(destructors,o)=>undefined})};var __emval_as=(handle,returnType,destructorsRef)=>{handle=Emval.toValue(handle);returnType=requireRegisteredType(returnType,"emval::as");var destructors=[];var rd=Emval.toHandle(destructors);HEAPU32[destructorsRef>>2]=rd;return returnType["toWireType"](destructors,handle)};var emval_allocateDestructors=destructorsRef=>{var destructors=[];HEAPU32[destructorsRef>>2]=Emval.toHandle(destructors);return destructors};var emval_symbols={};var getStringOrSymbol=address=>{var symbol=emval_symbols[address];if(symbol===undefined){return readLatin1String(address)}return symbol};var emval_methodCallers=[];var __emval_call_method=(caller,handle,methodName,destructorsRef,args)=>{caller=emval_methodCallers[caller];handle=Emval.toValue(handle);methodName=getStringOrSymbol(methodName);return caller(handle,methodName,emval_allocateDestructors(destructorsRef),args)};var __emval_call_void_method=(caller,handle,methodName,args)=>{caller=emval_methodCallers[caller];handle=Emval.toValue(handle);methodName=getStringOrSymbol(methodName);caller(handle,methodName,null,args)};var __emval_equals=(first,second)=>{first=Emval.toValue(first);second=Emval.toValue(second);return first==second};var emval_addMethodCaller=caller=>{var id=emval_methodCallers.length;emval_methodCallers.push(caller);return id};var emval_lookupTypes=(argCount,argTypes)=>{var a=new Array(argCount);for(var i=0;i>2],"parameter "+i)}return a};var emval_registeredMethods=[];var __emval_get_method_caller=(argCount,argTypes)=>{var types=emval_lookupTypes(argCount,argTypes);var retType=types[0];var signatureName=retType.name+"_$"+types.slice(1).map(function(t){return t.name}).join("_")+"$";var returnId=emval_registeredMethods[signatureName];if(returnId!==undefined){return returnId}var params=["retType"];var args=[retType];var argsList="";for(var i=0;i{handle=Emval.toValue(handle);key=Emval.toValue(key);return Emval.toHandle(handle[key])};var __emval_incref=handle=>{if(handle>4){emval_handles.get(handle).refcount+=1}};var __emval_new_cstring=v=>Emval.toHandle(getStringOrSymbol(v));var __emval_new_object=()=>Emval.toHandle({});var __emval_run_destructors=handle=>{var destructors=Emval.toValue(handle);runDestructors(destructors);__emval_decref(handle)};var __emval_set_property=(handle,key,value)=>{handle=Emval.toValue(handle);key=Emval.toValue(key);value=Emval.toValue(value);handle[key]=value};var __emval_take_value=(type,arg)=>{type=requireRegisteredType(type,"_emval_take_value");var v=type["readValueFromPointer"](arg);return Emval.toHandle(v)};var _abort=()=>{abort("")};var _emscripten_memcpy_big=(dest,src,num)=>HEAPU8.copyWithin(dest,src,src+num);var getHeapMax=()=>2147483648;var growMemory=size=>{var b=wasmMemory.buffer;var pages=(size-b.byteLength+65535)/65536;try{wasmMemory.grow(pages);updateMemoryViews();return 1}catch(e){}};var _emscripten_resize_heap=requestedSize=>{var oldSize=HEAPU8.length;requestedSize>>>=0;var maxHeapSize=getHeapMax();if(requestedSize>maxHeapSize){return false}var alignUp=(x,multiple)=>x+(multiple-x%multiple)%multiple;for(var cutDown=1;cutDown<=4;cutDown*=2){var overGrownHeapSize=oldSize*(1+.2/cutDown);overGrownHeapSize=Math.min(overGrownHeapSize,requestedSize+100663296);var newSize=Math.min(maxHeapSize,alignUp(Math.max(requestedSize,overGrownHeapSize),65536));var replacement=growMemory(newSize);if(replacement){return true}}return false};var ENV={};var getExecutableName=()=>thisProgram||"./this.program";var getEnvStrings=()=>{if(!getEnvStrings.strings){var lang=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){if(ENV[x]===undefined)delete env[x];else env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(`${x}=${env[x]}`)}getEnvStrings.strings=strings}return getEnvStrings.strings};var stringToAscii=(str,buffer)=>{for(var i=0;i>0]=str.charCodeAt(i)}HEAP8[buffer>>0]=0};var PATH={isAbs:path=>path.charAt(0)==="/",splitPath:filename=>{var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:(parts,allowAboveRoot)=>{var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:path=>{var isAbsolute=PATH.isAbs(path),trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(p=>!!p),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:path=>{var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:path=>{if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},join:function(){var paths=Array.prototype.slice.call(arguments);return PATH.normalize(paths.join("/"))},join2:(l,r)=>PATH.normalize(l+"/"+r)};var initRandomFill=()=>{if(typeof crypto=="object"&&typeof crypto["getRandomValues"]=="function"){return view=>crypto.getRandomValues(view)}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");var randomFillSync=crypto_module["randomFillSync"];if(randomFillSync){return view=>crypto_module["randomFillSync"](view)}var randomBytes=crypto_module["randomBytes"];return view=>(view.set(randomBytes(view.byteLength)),view)}catch(e){}}abort("initRandomDevice")};var randomFill=view=>(randomFill=initRandomFill())(view);var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=PATH.isAbs(path)}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(p=>!!p),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:(from,to)=>{from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var FS_stdin_getChar=()=>{if(!FS_stdin_getChar_buffer.length){var result=null;if(ENVIRONMENT_IS_NODE){var BUFSIZE=256;var buf=Buffer.alloc(BUFSIZE);var bytesRead=0;var fd=process.stdin.fd;try{bytesRead=fs.readSync(fd,buf)}catch(e){if(e.toString().includes("EOF"))bytesRead=0;else throw e}if(bytesRead>0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}FS_stdin_getChar_buffer=intArrayFromString(result,true)}return FS_stdin_getChar_buffer.shift()};var TTY={ttys:[],init(){},shutdown(){},register(dev,ops){TTY.ttys[dev]={input:[],output:[],ops:ops};FS.registerDevice(dev,TTY.stream_ops)},stream_ops:{open(stream){var tty=TTY.ttys[stream.node.rdev];if(!tty){throw new FS.ErrnoError(43)}stream.tty=tty;stream.seekable=false},close(stream){stream.tty.ops.fsync(stream.tty)},fsync(stream){stream.tty.ops.fsync(stream.tty)},read(stream,buffer,offset,length,pos){if(!stream.tty||!stream.tty.ops.get_char){throw new FS.ErrnoError(60)}var bytesRead=0;for(var i=0;i0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}},ioctl_tcgets(tty){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(tty,optional_actions,data){return 0},ioctl_tiocgwinsz(tty){return[24,80]}},default_tty1_ops:{put_char(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},fsync(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};var mmapAlloc=size=>{abort()};var MEMFS={ops_table:null,mount(mount){return MEMFS.createNode(null,"/",16384|511,0)},createNode(parent,name,mode,dev){if(FS.isBlkdev(mode)||FS.isFIFO(mode)){throw new FS.ErrnoError(63)}if(!MEMFS.ops_table){MEMFS.ops_table={dir:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,lookup:MEMFS.node_ops.lookup,mknod:MEMFS.node_ops.mknod,rename:MEMFS.node_ops.rename,unlink:MEMFS.node_ops.unlink,rmdir:MEMFS.node_ops.rmdir,readdir:MEMFS.node_ops.readdir,symlink:MEMFS.node_ops.symlink},stream:{llseek:MEMFS.stream_ops.llseek}},file:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:{llseek:MEMFS.stream_ops.llseek,read:MEMFS.stream_ops.read,write:MEMFS.stream_ops.write,allocate:MEMFS.stream_ops.allocate,mmap:MEMFS.stream_ops.mmap,msync:MEMFS.stream_ops.msync}},link:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,readlink:MEMFS.node_ops.readlink},stream:{}},chrdev:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:FS.chrdev_stream_ops}}}var node=FS.createNode(parent,name,mode,dev);if(FS.isDir(node.mode)){node.node_ops=MEMFS.ops_table.dir.node;node.stream_ops=MEMFS.ops_table.dir.stream;node.contents={}}else if(FS.isFile(node.mode)){node.node_ops=MEMFS.ops_table.file.node;node.stream_ops=MEMFS.ops_table.file.stream;node.usedBytes=0;node.contents=null}else if(FS.isLink(node.mode)){node.node_ops=MEMFS.ops_table.link.node;node.stream_ops=MEMFS.ops_table.link.stream}else if(FS.isChrdev(node.mode)){node.node_ops=MEMFS.ops_table.chrdev.node;node.stream_ops=MEMFS.ops_table.chrdev.stream}node.timestamp=Date.now();if(parent){parent.contents[name]=node;parent.timestamp=node.timestamp}return node},getFileDataAsTypedArray(node){if(!node.contents)return new Uint8Array(0);if(node.contents.subarray)return node.contents.subarray(0,node.usedBytes);return new Uint8Array(node.contents)},expandFileStorage(node,newCapacity){var prevCapacity=node.contents?node.contents.length:0;if(prevCapacity>=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup(parent,name){throw FS.genericErrors[44]},mknod(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length{var dep=!noRunDep?getUniqueRunDependency(`al ${url}`):"";readAsync(url,arrayBuffer=>{assert(arrayBuffer,`Loading data file "${url}" failed (no arrayBuffer).`);onload(new Uint8Array(arrayBuffer));if(dep)removeRunDependency(dep)},event=>{if(onerror){onerror()}else{throw`Loading data file "${url}" failed.`}});if(dep)addRunDependency(dep)};var preloadPlugins=Module["preloadPlugins"]||[];var FS_handledByPreloadPlugin=(byteArray,fullname,finish,onerror)=>{if(typeof Browser!="undefined")Browser.init();var handled=false;preloadPlugins.forEach(plugin=>{if(handled)return;if(plugin["canHandle"](fullname)){plugin["handle"](byteArray,fullname,finish,onerror);handled=true}});return handled};var FS_createPreloadedFile=(parent,name,url,canRead,canWrite,onload,onerror,dontCreateFile,canOwn,preFinish)=>{var fullname=name?PATH_FS.resolve(PATH.join2(parent,name)):parent;var dep=getUniqueRunDependency(`cp ${fullname}`);function processData(byteArray){function finish(byteArray){if(preFinish)preFinish();if(!dontCreateFile){FS.createDataFile(parent,name,byteArray,canRead,canWrite,canOwn)}if(onload)onload();removeRunDependency(dep)}if(FS_handledByPreloadPlugin(byteArray,fullname,finish,()=>{if(onerror)onerror();removeRunDependency(dep)})){return}finish(byteArray)}addRunDependency(dep);if(typeof url=="string"){asyncLoad(url,byteArray=>processData(byteArray),onerror)}else{processData(url)}};var FS_modeStringToFlags=str=>{var flagModes={"r":0,"r+":2,"w":512|64|1,"w+":512|64|2,"a":1024|64|1,"a+":1024|64|2};var flags=flagModes[str];if(typeof flags=="undefined"){throw new Error(`Unknown file open mode: ${str}`)}return flags};var FS_getMode=(canRead,canWrite)=>{var mode=0;if(canRead)mode|=292|73;if(canWrite)mode|=146;return mode};var FS={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:false,ignorePermissions:true,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath(path,opts={}){path=PATH_FS.resolve(path);if(!path)return{path:"",node:null};var defaults={follow_mount:true,recurse_count:0};opts=Object.assign(defaults,opts);if(opts.recurse_count>8){throw new FS.ErrnoError(32)}var parts=path.split("/").filter(p=>!!p);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?`${mount}/${path}`:mount+path}path=path?`${node.name}/${path}`:node.name;node=node.parent}},hashName(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode(node){FS.hashRemoveNode(node)},isRoot(node){return node===node.parent},isMountpoint(node){return!!node.mounted},isFile(mode){return(mode&61440)===32768},isDir(mode){return(mode&61440)===16384},isLink(mode){return(mode&61440)===40960},isChrdev(mode){return(mode&61440)===8192},isBlkdev(mode){return(mode&61440)===24576},isFIFO(mode){return(mode&61440)===4096},isSocket(mode){return(mode&49152)===49152},flagsToPermissionString(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd(){for(var fd=0;fd<=FS.MAX_OPEN_FDS;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStreamChecked(fd){var stream=FS.getStream(fd);if(!stream){throw new FS.ErrnoError(8)}return stream},getStream:fd=>FS.streams[fd],createStream(stream,fd=-1){if(!FS.FSStream){FS.FSStream=function(){this.shared={}};FS.FSStream.prototype={};Object.defineProperties(FS.FSStream.prototype,{object:{get(){return this.node},set(val){this.node=val}},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(val){this.shared.flags=val}},position:{get(){return this.shared.position},set(val){this.shared.position=val}}})}stream=Object.assign(new FS.FSStream,stream);if(fd==-1){fd=FS.nextfd()}stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream(fd){FS.streams[fd]=null},chrdev_stream_ops:{open(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek(){throw new FS.ErrnoError(70)}},major:dev=>dev>>8,minor:dev=>dev&255,makedev:(ma,mi)=>ma<<8|mi,registerDevice(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:dev=>FS.devices[dev],getMounts(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs(populate,callback){if(typeof populate=="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err(`warning: ${FS.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`)}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(mount=>{if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(hash=>{var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup(parent,name){return parent.node_ops.lookup(parent,name)},mknod(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree(path,mode){var dirs=path.split("/");var d="";for(var i=0;i0,ioctl(stream,cmd,arg){if(!stream.stream_ops.ioctl){throw new FS.ErrnoError(59)}return stream.stream_ops.ioctl(stream,cmd,arg)},readFile(path,opts={}){opts.flags=opts.flags||0;opts.encoding=opts.encoding||"binary";if(opts.encoding!=="utf8"&&opts.encoding!=="binary"){throw new Error(`Invalid encoding type "${opts.encoding}"`)}var ret;var stream=FS.open(path,opts.flags);var stat=FS.stat(path);var length=stat.size;var buf=new Uint8Array(length);FS.read(stream,buf,0,length,0);if(opts.encoding==="utf8"){ret=UTF8ArrayToString(buf,0)}else if(opts.encoding==="binary"){ret=buf}FS.close(stream);return ret},writeFile(path,data,opts={}){opts.flags=opts.flags||577;var stream=FS.open(path,opts.flags,opts.mode);if(typeof data=="string"){var buf=new Uint8Array(lengthBytesUTF8(data)+1);var actualNumBytes=stringToUTF8Array(data,buf,0,buf.length);FS.write(stream,buf,0,actualNumBytes,undefined,opts.canOwn)}else if(ArrayBuffer.isView(data)){FS.write(stream,data,0,data.byteLength,undefined,opts.canOwn)}else{throw new Error("Unsupported data type")}FS.close(stream)},cwd:()=>FS.currentPath,chdir(path){var lookup=FS.lookupPath(path,{follow:true});if(lookup.node===null){throw new FS.ErrnoError(44)}if(!FS.isDir(lookup.node.mode)){throw new FS.ErrnoError(54)}var errCode=FS.nodePermissions(lookup.node,"x");if(errCode){throw new FS.ErrnoError(errCode)}FS.currentPath=lookup.path},createDefaultDirectories(){FS.mkdir("/tmp");FS.mkdir("/home");FS.mkdir("/home/web_user")},createDefaultDevices(){FS.mkdir("/dev");FS.registerDevice(FS.makedev(1,3),{read:()=>0,write:(stream,buffer,offset,length,pos)=>length});FS.mkdev("/dev/null",FS.makedev(1,3));TTY.register(FS.makedev(5,0),TTY.default_tty_ops);TTY.register(FS.makedev(6,0),TTY.default_tty1_ops);FS.mkdev("/dev/tty",FS.makedev(5,0));FS.mkdev("/dev/tty1",FS.makedev(6,0));var randomBuffer=new Uint8Array(1024),randomLeft=0;var randomByte=()=>{if(randomLeft===0){randomLeft=randomFill(randomBuffer).byteLength}return randomBuffer[--randomLeft]};FS.createDevice("/dev","random",randomByte);FS.createDevice("/dev","urandom",randomByte);FS.mkdir("/dev/shm");FS.mkdir("/dev/shm/tmp")},createSpecialDirectories(){FS.mkdir("/proc");var proc_self=FS.mkdir("/proc/self");FS.mkdir("/proc/self/fd");FS.mount({mount(){var node=FS.createNode(proc_self,"fd",16384|511,73);node.node_ops={lookup(parent,name){var fd=+name;var stream=FS.getStreamChecked(fd);var ret={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>stream.path}};ret.parent=ret;return ret}};return node}},{},"/proc/self/fd")},createStandardStreams(){if(Module["stdin"]){FS.createDevice("/dev","stdin",Module["stdin"])}else{FS.symlink("/dev/tty","/dev/stdin")}if(Module["stdout"]){FS.createDevice("/dev","stdout",null,Module["stdout"])}else{FS.symlink("/dev/tty","/dev/stdout")}if(Module["stderr"]){FS.createDevice("/dev","stderr",null,Module["stderr"])}else{FS.symlink("/dev/tty1","/dev/stderr")}var stdin=FS.open("/dev/stdin",0);var stdout=FS.open("/dev/stdout",1);var stderr=FS.open("/dev/stderr",1)},ensureErrnoError(){if(FS.ErrnoError)return;FS.ErrnoError=function ErrnoError(errno,node){this.name="ErrnoError";this.node=node;this.setErrno=function(errno){this.errno=errno};this.setErrno(errno);this.message="FS error"};FS.ErrnoError.prototype=new Error;FS.ErrnoError.prototype.constructor=FS.ErrnoError;[44].forEach(code=>{FS.genericErrors[code]=new FS.ErrnoError(code);FS.genericErrors[code].stack=""})},staticInit(){FS.ensureErrnoError();FS.nameTable=new Array(4096);FS.mount(MEMFS,{},"/");FS.createDefaultDirectories();FS.createDefaultDevices();FS.createSpecialDirectories();FS.filesystems={"MEMFS":MEMFS}},init(input,output,error){FS.init.initialized=true;FS.ensureErrnoError();Module["stdin"]=input||Module["stdin"];Module["stdout"]=output||Module["stdout"];Module["stderr"]=error||Module["stderr"];FS.createStandardStreams()},quit(){FS.init.initialized=false;for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=(from,to)=>{if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}return intArrayFromString(xhr.responseText||"",true)};var lazyArray=this;lazyArray.setDataGetter(chunkNum=>{var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]=="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]=="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(key=>{var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});function writeChunks(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i{FS.forceLoadFile(node);return writeChunks(stream,buffer,offset,length,position)};stream_ops.mmap=(stream,length,position,prot,flags)=>{FS.forceLoadFile(node);var ptr=mmapAlloc(length);if(!ptr){throw new FS.ErrnoError(48)}writeChunks(stream,HEAP8,ptr,length,position);return{ptr:ptr,allocated:true}};node.stream_ops=stream_ops;return node}};var SYSCALLS={DEFAULT_POLLMASK:5,calculateAt(dirfd,path,allowEmpty){if(PATH.isAbs(path)){return path}var dir;if(dirfd===-100){dir=FS.cwd()}else{var dirstream=SYSCALLS.getStreamFromFD(dirfd);dir=dirstream.path}if(path.length==0){if(!allowEmpty){throw new FS.ErrnoError(44)}return dir}return PATH.join2(dir,path)},doStat(func,path,buf){try{var stat=func(path)}catch(e){if(e&&e.node&&PATH.normalize(path)!==PATH.normalize(FS.getPath(e.node))){return-54}throw e}HEAP32[buf>>2]=stat.dev;HEAP32[buf+4>>2]=stat.mode;HEAPU32[buf+8>>2]=stat.nlink;HEAP32[buf+12>>2]=stat.uid;HEAP32[buf+16>>2]=stat.gid;HEAP32[buf+20>>2]=stat.rdev;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+24>>2]=tempI64[0],HEAP32[buf+28>>2]=tempI64[1];HEAP32[buf+32>>2]=4096;HEAP32[buf+36>>2]=stat.blocks;var atime=stat.atime.getTime();var mtime=stat.mtime.getTime();var ctime=stat.ctime.getTime();tempI64=[Math.floor(atime/1e3)>>>0,(tempDouble=Math.floor(atime/1e3),+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAPU32[buf+48>>2]=atime%1e3*1e3;tempI64=[Math.floor(mtime/1e3)>>>0,(tempDouble=Math.floor(mtime/1e3),+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+56>>2]=tempI64[0],HEAP32[buf+60>>2]=tempI64[1];HEAPU32[buf+64>>2]=mtime%1e3*1e3;tempI64=[Math.floor(ctime/1e3)>>>0,(tempDouble=Math.floor(ctime/1e3),+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+72>>2]=tempI64[0],HEAP32[buf+76>>2]=tempI64[1];HEAPU32[buf+80>>2]=ctime%1e3*1e3;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+88>>2]=tempI64[0],HEAP32[buf+92>>2]=tempI64[1];return 0},doMsync(addr,stream,len,flags,offset){if(!FS.isFile(stream.node.mode)){throw new FS.ErrnoError(43)}if(flags&2){return 0}var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},varargs:undefined,get(){var ret=HEAP32[SYSCALLS.varargs>>2];SYSCALLS.varargs+=4;return ret},getp(){return SYSCALLS.get()},getStr(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD(fd){var stream=FS.getStreamChecked(fd);return stream}};var _environ_get=(__environ,environ_buf)=>{var bufSize=0;getEnvStrings().forEach((string,i)=>{var ptr=environ_buf+bufSize;HEAPU32[__environ+i*4>>2]=ptr;stringToAscii(string,ptr);bufSize+=string.length+1});return 0};var _environ_sizes_get=(penviron_count,penviron_buf_size)=>{var strings=getEnvStrings();HEAPU32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(string=>bufSize+=string.length+1);HEAPU32[penviron_buf_size>>2]=bufSize;return 0};function _fd_close(fd){try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return e.errno}}var doReadv=(stream,iov,iovcnt,offset)=>{var ret=0;for(var i=0;i>2];var len=HEAPU32[iov+4>>2];iov+=8;var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2]=num;return 0}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return e.errno}}var convertI32PairToI53Checked=(lo,hi)=>hi+2097152>>>0<4194305-!!lo?(lo>>>0)+hi*4294967296:NaN;function _fd_seek(fd,offset_low,offset_high,whence,newOffset){var offset=convertI32PairToI53Checked(offset_low,offset_high);try{if(isNaN(offset))return 61;var stream=SYSCALLS.getStreamFromFD(fd);FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return e.errno}}var doWritev=(stream,iov,iovcnt,offset)=>{var ret=0;for(var i=0;i>2];var len=HEAPU32[iov+4>>2];iov+=8;var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(typeof offset!=="undefined"){offset+=curr}}return ret};function _fd_write(fd,iov,iovcnt,pnum){try{var stream=SYSCALLS.getStreamFromFD(fd);var num=doWritev(stream,iov,iovcnt);HEAPU32[pnum>>2]=num;return 0}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return e.errno}}var _llvm_eh_typeid_for=type=>type;var isLeapYear=year=>year%4===0&&(year%100!==0||year%400===0);var arraySum=(array,index)=>{var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum};var MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];var addDays=(date,days)=>{var newDate=new Date(date.getTime());while(days>0){var leap=isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?MONTH_DAYS_LEAP:MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate};var writeArrayToMemory=(array,buffer)=>{HEAP8.set(array,buffer)};var _strftime=(s,maxsize,format,tm)=>{var tm_zone=HEAPU32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%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 rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value=="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}return thisDate.getFullYear()}return thisDate.getFullYear()-1}var EXPANSION_RULES_2={"%a":date=>WEEKDAYS[date.tm_wday].substring(0,3),"%A":date=>WEEKDAYS[date.tm_wday],"%b":date=>MONTHS[date.tm_mon].substring(0,3),"%B":date=>MONTHS[date.tm_mon],"%C":date=>{var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":date=>leadingNulls(date.tm_mday,2),"%e":date=>leadingSomething(date.tm_mday,2," "),"%g":date=>getWeekBasedYear(date).toString().substring(2),"%G":date=>getWeekBasedYear(date),"%H":date=>leadingNulls(date.tm_hour,2),"%I":date=>{var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":date=>leadingNulls(date.tm_mday+arraySum(isLeapYear(date.tm_year+1900)?MONTH_DAYS_LEAP:MONTH_DAYS_REGULAR,date.tm_mon-1),3),"%m":date=>leadingNulls(date.tm_mon+1,2),"%M":date=>leadingNulls(date.tm_min,2),"%n":()=>"\n","%p":date=>{if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}return"PM"},"%S":date=>leadingNulls(date.tm_sec,2),"%t":()=>"\t","%u":date=>date.tm_wday||7,"%U":date=>{var days=date.tm_yday+7-date.tm_wday;return leadingNulls(Math.floor(days/7),2)},"%V":date=>{var val=Math.floor((date.tm_yday+7-(date.tm_wday+6)%7)/7);if((date.tm_wday+371-date.tm_yday-2)%7<=2){val++}if(!val){val=52;var dec31=(date.tm_wday+7-date.tm_yday-1)%7;if(dec31==4||dec31==5&&isLeapYear(date.tm_year%400-1)){val++}}else if(val==53){var jan1=(date.tm_wday+371-date.tm_yday)%7;if(jan1!=4&&(jan1!=3||!isLeapYear(date.tm_year)))val=1}return leadingNulls(val,2)},"%w":date=>date.tm_wday,"%W":date=>{var days=date.tm_yday+7-(date.tm_wday+6)%7;return leadingNulls(Math.floor(days/7),2)},"%y":date=>(date.tm_year+1900).toString().substring(2),"%Y":date=>date.tm_year+1900,"%z":date=>{var off=date.tm_gmtoff;var ahead=off>=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":date=>date.tm_zone,"%%":()=>"%"};pattern=pattern.replace(/%%/g,"\0\0");for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}pattern=pattern.replace(/\0\0/g,"%");var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1};var _strftime_l=(s,maxsize,format,tm,loc)=>_strftime(s,maxsize,format,tm);var uleb128Encode=(n,target)=>{if(n<128){target.push(n)}else{target.push(n%128|128,n>>7)}};var sigToWasmTypes=sig=>{var typeNames={"i":"i32","j":"i64","f":"f32","d":"f64","p":"i32"};var type={parameters:[],results:sig[0]=="v"?[]:[typeNames[sig[0]]]};for(var i=1;i{var sigRet=sig.slice(0,1);var sigParam=sig.slice(1);var typeCodes={"i":127,"p":127,"j":126,"f":125,"d":124};target.push(96);uleb128Encode(sigParam.length,target);for(var i=0;i{if(typeof WebAssembly.Function=="function"){return new WebAssembly.Function(sigToWasmTypes(sig),func)}var typeSectionBody=[1];generateFuncType(sig,typeSectionBody);var bytes=[0,97,115,109,1,0,0,0,1];uleb128Encode(typeSectionBody.length,bytes);bytes.push.apply(bytes,typeSectionBody);bytes.push(2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0);var module=new WebAssembly.Module(new Uint8Array(bytes));var instance=new WebAssembly.Instance(module,{"e":{"f":func}});var wrappedFunc=instance.exports["f"];return wrappedFunc};var updateTableMap=(offset,count)=>{if(functionsInTableMap){for(var i=offset;i{if(!functionsInTableMap){functionsInTableMap=new WeakMap;updateTableMap(0,wasmTable.length)}return functionsInTableMap.get(func)||0};var freeTableIndexes=[];var getEmptyTableSlot=()=>{if(freeTableIndexes.length){return freeTableIndexes.pop()}try{wasmTable.grow(1)}catch(err){if(!(err instanceof RangeError)){throw err}throw"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH."}return wasmTable.length-1};var setWasmTableEntry=(idx,func)=>{wasmTable.set(idx,func);wasmTableMirror[idx]=wasmTable.get(idx)};var addFunction=(func,sig)=>{var rtn=getFunctionAddress(func);if(rtn){return rtn}var ret=getEmptyTableSlot();try{setWasmTableEntry(ret,func)}catch(err){if(!(err instanceof TypeError)){throw err}var wrapped=convertJsFunctionToWasm(func,sig);setWasmTableEntry(ret,wrapped)}functionsInTableMap.set(func,ret);return ret};var removeFunction=index=>{functionsInTableMap.delete(getWasmTableEntry(index));freeTableIndexes.push(index)};InternalError=Module["InternalError"]=class InternalError extends Error{constructor(message){super(message);this.name="InternalError"}};embind_init_charCodes();BindingError=Module["BindingError"]=class BindingError extends Error{constructor(message){super(message);this.name="BindingError"}};init_ClassHandle();init_embind();init_RegisteredPointer();UnboundTypeError=Module["UnboundTypeError"]=extendError(Error,"UnboundTypeError");handleAllocatorInit();init_emval();var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.createPreloadedFile=FS_createPreloadedFile;FS.staticInit();var wasmImports={C:___cxa_begin_catch,M:___cxa_end_catch,a:___cxa_find_matching_catch_2,k:___cxa_find_matching_catch_3,U:___cxa_rethrow,h:___cxa_throw,qa:___cxa_uncaught_exceptions,d:___resumeException,Ka:__embind_finalize_value_object,da:__embind_register_bigint,va:__embind_register_bool,y:__embind_register_class,x:__embind_register_class_constructor,j:__embind_register_class_function,ta:__embind_register_emval,Q:__embind_register_enum,t:__embind_register_enum_value,W:__embind_register_float,o:__embind_register_function,A:__embind_register_integer,s:__embind_register_memory_view,V:__embind_register_std_string,O:__embind_register_std_wstring,F:__embind_register_value_object,La:__embind_register_value_object_field,wa:__embind_register_void,Qa:__emval_as,Fa:__emval_call_method,Na:__emval_call_void_method,Sa:__emval_decref,Pa:__emval_equals,Ja:__emval_get_method_caller,Ra:__emval_get_property,Oa:__emval_incref,H:__emval_new_cstring,aa:__emval_new_object,ua:__emval_run_destructors,Ta:__emval_set_property,z:__emval_take_value,N:_abort,sa:_emscripten_memcpy_big,ra:_emscripten_resize_heap,ma:_environ_get,na:_environ_sizes_get,oa:_fd_close,pa:_fd_read,ca:_fd_seek,T:_fd_write,za:invoke_d,G:invoke_ddi,J:invoke_diii,B:invoke_diiiii,E:invoke_ff,$:invoke_fii,xa:invoke_fiif,R:invoke_fiii,Ca:invoke_fiiif,r:invoke_i,c:invoke_ii,b:invoke_iii,n:invoke_iiii,l:invoke_iiiii,P:invoke_iiiiii,D:invoke_iiiiiii,S:invoke_iiiiiiii,L:invoke_iiiiiiiiiiii,ba:invoke_jiiii,i:invoke_v,f:invoke_vi,Ha:invoke_vidi,g:invoke_vii,Da:invoke_viid,I:invoke_viiddi,_:invoke_viidi,Ia:invoke_viidiidid,u:invoke_viif,Ba:invoke_viiff,Aa:invoke_viifff,Ea:invoke_viififi,e:invoke_viii,Ma:invoke_viiiffi,m:invoke_viiii,q:invoke_viiiii,ya:invoke_viiiiid,Z:invoke_viiiiif,v:invoke_viiiiii,w:invoke_viiiiiii,X:invoke_viiiiiiiii,p:invoke_viiiiiiiiii,K:invoke_viiiiiiiiiiiiiii,Y:invoke_viiiiiiiiiiiiiiiiii,fa:invoke_viiiij,ia:invoke_viiij,ka:invoke_viiji,ja:invoke_viijii,ga:invoke_vijii,ha:invoke_vijiii,ea:invoke_vijij,Ga:_llvm_eh_typeid_for,la:_strftime_l};var wasmExports=createWasm();var ___wasm_call_ctors=()=>(___wasm_call_ctors=wasmExports["Va"])();var ___cxa_free_exception=a0=>(___cxa_free_exception=wasmExports["__cxa_free_exception"])(a0);var _malloc=a0=>(_malloc=wasmExports["Xa"])(a0);var _free=a0=>(_free=wasmExports["Ya"])(a0);var ___getTypeName=a0=>(___getTypeName=wasmExports["Za"])(a0);var __embind_initialize_bindings=Module["__embind_initialize_bindings"]=()=>(__embind_initialize_bindings=Module["__embind_initialize_bindings"]=wasmExports["_a"])();var ___errno_location=()=>(___errno_location=wasmExports["__errno_location"])();var _setThrew=(a0,a1)=>(_setThrew=wasmExports["$a"])(a0,a1);var setTempRet0=a0=>(setTempRet0=wasmExports["ab"])(a0);var stackSave=()=>(stackSave=wasmExports["bb"])();var stackRestore=a0=>(stackRestore=wasmExports["cb"])(a0);var ___cxa_decrement_exception_refcount=a0=>(___cxa_decrement_exception_refcount=wasmExports["db"])(a0);var ___cxa_increment_exception_refcount=a0=>(___cxa_increment_exception_refcount=wasmExports["eb"])(a0);var ___cxa_can_catch=(a0,a1,a2)=>(___cxa_can_catch=wasmExports["fb"])(a0,a1,a2);var ___cxa_is_pointer_type=a0=>(___cxa_is_pointer_type=wasmExports["gb"])(a0);var dynCall_viiji=Module["dynCall_viiji"]=(a0,a1,a2,a3,a4,a5)=>(dynCall_viiji=Module["dynCall_viiji"]=wasmExports["hb"])(a0,a1,a2,a3,a4,a5);var dynCall_viijii=Module["dynCall_viijii"]=(a0,a1,a2,a3,a4,a5,a6)=>(dynCall_viijii=Module["dynCall_viijii"]=wasmExports["ib"])(a0,a1,a2,a3,a4,a5,a6);var dynCall_viiij=Module["dynCall_viiij"]=(a0,a1,a2,a3,a4,a5)=>(dynCall_viiij=Module["dynCall_viiij"]=wasmExports["jb"])(a0,a1,a2,a3,a4,a5);var dynCall_vijiii=Module["dynCall_vijiii"]=(a0,a1,a2,a3,a4,a5,a6)=>(dynCall_vijiii=Module["dynCall_vijiii"]=wasmExports["kb"])(a0,a1,a2,a3,a4,a5,a6);var dynCall_vijii=Module["dynCall_vijii"]=(a0,a1,a2,a3,a4,a5)=>(dynCall_vijii=Module["dynCall_vijii"]=wasmExports["lb"])(a0,a1,a2,a3,a4,a5);var dynCall_viiiij=Module["dynCall_viiiij"]=(a0,a1,a2,a3,a4,a5,a6)=>(dynCall_viiiij=Module["dynCall_viiiij"]=wasmExports["mb"])(a0,a1,a2,a3,a4,a5,a6);var dynCall_vijij=Module["dynCall_vijij"]=(a0,a1,a2,a3,a4,a5,a6)=>(dynCall_vijij=Module["dynCall_vijij"]=wasmExports["nb"])(a0,a1,a2,a3,a4,a5,a6);var dynCall_jiji=Module["dynCall_jiji"]=(a0,a1,a2,a3,a4)=>(dynCall_jiji=Module["dynCall_jiji"]=wasmExports["ob"])(a0,a1,a2,a3,a4);var dynCall_jiiii=Module["dynCall_jiiii"]=(a0,a1,a2,a3,a4)=>(dynCall_jiiii=Module["dynCall_jiiii"]=wasmExports["pb"])(a0,a1,a2,a3,a4);var dynCall_iiiiij=Module["dynCall_iiiiij"]=(a0,a1,a2,a3,a4,a5,a6)=>(dynCall_iiiiij=Module["dynCall_iiiiij"]=wasmExports["qb"])(a0,a1,a2,a3,a4,a5,a6);var dynCall_iiiiijj=Module["dynCall_iiiiijj"]=(a0,a1,a2,a3,a4,a5,a6,a7,a8)=>(dynCall_iiiiijj=Module["dynCall_iiiiijj"]=wasmExports["rb"])(a0,a1,a2,a3,a4,a5,a6,a7,a8);var dynCall_iiiiiijj=Module["dynCall_iiiiiijj"]=(a0,a1,a2,a3,a4,a5,a6,a7,a8,a9)=>(dynCall_iiiiiijj=Module["dynCall_iiiiiijj"]=wasmExports["sb"])(a0,a1,a2,a3,a4,a5,a6,a7,a8,a9);function invoke_viii(index,a1,a2,a3){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iii(index,a1,a2){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_diiiii(index,a1,a2,a3,a4,a5){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_vi(index,a1){var sp=stackSave();try{getWasmTableEntry(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_ii(index,a1){var sp=stackSave();try{return getWasmTableEntry(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_diii(index,a1,a2,a3){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_vii(index,a1,a2){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiii(index,a1,a2,a3,a4){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiiii(index,a1,a2,a3,a4){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiii(index,a1,a2,a3){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiiffi(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_fii(index,a1,a2){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_v(index){var sp=stackSave();try{getWasmTableEntry(index)()}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_ddi(index,a1,a2){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_ff(index,a1){var sp=stackSave();try{return getWasmTableEntry(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiiii(index,a1,a2,a3,a4,a5){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viidi(index,a1,a2,a3,a4){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viidiidid(index,a1,a2,a3,a4,a5,a6,a7,a8){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6,a7,a8)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiddi(index,a1,a2,a3,a4,a5){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_vidi(index,a1,a2,a3){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viif(index,a1,a2,a3){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viififi(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiiiii(index,a1,a2,a3,a4,a5){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiiiii(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiiiif(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiiiiiiiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiiiiii(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6,a7)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_i(index){var sp=stackSave();try{return getWasmTableEntry(index)()}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viid(index,a1,a2,a3){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_fiiif(index,a1,a2,a3,a4){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiff(index,a1,a2,a3,a4){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viifff(index,a1,a2,a3,a4,a5){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_d(index){var sp=stackSave();try{return getWasmTableEntry(index)()}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiiiid(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_fiif(index,a1,a2,a3){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiiiiii(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiiiiiii(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6,a7)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_fiii(index,a1,a2,a3){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiiiiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiji(index,a1,a2,a3,a4,a5){var sp=stackSave();try{dynCall_viiji(index,a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viijii(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{dynCall_viijii(index,a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiij(index,a1,a2,a3,a4,a5){var sp=stackSave();try{dynCall_viiij(index,a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_vijiii(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{dynCall_vijiii(index,a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_vijii(index,a1,a2,a3,a4,a5){var sp=stackSave();try{dynCall_vijii(index,a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiiij(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{dynCall_viiiij(index,a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_vijij(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{dynCall_vijij(index,a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_jiiii(index,a1,a2,a3,a4){var sp=stackSave();try{return dynCall_jiiii(index,a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}Module["addFunction"]=addFunction;Module["removeFunction"]=removeFunction;var calledRun;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function run(){if(runDependencies>0){return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();readyPromiseResolve(Module);if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}run(); + + + return moduleArg.ready +} + +); +})(); +export default Module; \ No newline at end of file diff --git a/manifold.wasm b/manifold.wasm new file mode 100644 index 000000000..caeaf5993 Binary files /dev/null and b/manifold.wasm differ diff --git a/model-viewer.html b/model-viewer.html new file mode 100644 index 000000000..42f3accd0 --- /dev/null +++ b/model-viewer.html @@ -0,0 +1,59 @@ + + + + + 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..d8b4ab05f Binary files /dev/null and b/models/moon.glb differ diff --git a/models/space.glb b/models/space.glb new file mode 100644 index 000000000..a0af95f43 Binary files /dev/null and b/models/space.glb differ diff --git a/samples/CMakeLists.txt b/samples/CMakeLists.txt new file mode 100644 index 000000000..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..c11ec91dc --- /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.6; + + 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