memoscan
← all memos

Memo 0x799957cb…17f854 on Ethereum

jb_mass_main1gativeSpaceY);let s=randFromRange(a.negativeSpaceZ);let l=randFromRange(a.negativeSpaceSizeX);let c=randFromRange(a.negativeSpaceSizeY);let f=randFromRange(a.negativeSpaceSizeZ);if(e==undefined){e=pick(a.negativeSpaceType)}let p=undefined;if(e=="triangle"){p=[new THREE.Plane(new THREE.Vector3(1,.5,0),0),new THREE.Plane(new THREE.Vector3(-1,.5,0),0),new THREE.Plane(new THREE.Vector3(0,-1,0),0),new THREE.Plane(new THREE.Vector3(0,0,-1),0),new THREE.Plane(new THREE.Vector3(0,0,1),0)];p[0].translate(new THREE.Vector3(l+r,0,0));p[1].translate(new THREE.Vector3(-l+r,0,0));p[2].translate(new THREE.Vector3(0,-c+o,0));p[3].translate(new THREE.Vector3(0,0,-f+s));p[4].translate(new THREE.Vector3(0,0,f+s))}else if(e=="triangle_flip"){p=[new THREE.Plane(new THREE.Vector3(1,-.5,0),0),new THREE.Plane(new THREE.Vector3(-1,-.5,0),0),new THREE.Plane(new THREE.Vector3(0,1,0),0),new THREE.Plane(new THREE.Vector3(0,0,-1),0),new THREE.Plane(new THREE.Vector3(0,0,1),0)];p[0].translate(new THREE.Vector3(l+r,0,0));p[1].translate(new THREE.Vector3(-l+r,0,0));p[2].translate(new THREE.Vector3(0,c+o,0));p[3].translate(new THREE.Vector3(0,0,-f+s));p[4].translate(new THREE.Vector3(0,0,f+s))}else if(e=="diamond"){p=[new THREE.Plane(new THREE.Vector3(1,-.5,0),0),new THREE.Plane(new THREE.Vector3(-1,.5,0),0),new THREE.Plane(new THREE.Vector3(.5,-1,0),0),new THREE.Plane(new THREE.Vector3(-.5,1,0),0),new THREE.Plane(new THREE.Vector3(0,0,-1),0),new THREE.Plane(new THREE.Vector3(0,0,1),0)];p[0].translate(new THREE.Vector3(l+r,0,0));p[1].translate(new THREE.Vector3(-l+r,0,0));p[2].translate(new THREE.Vector3(0,-c+o,0));p[3].translate(new THREE.Vector3(0,c+o,0));p[4].translate(new THREE.Vector3(0,0,-f+s));p[5].translate(new THREE.Vector3(0,0,f+s));var d=new THREE.Quaternion;d.setFromAxisAngle(new THREE.Vector3(0,0,1),THREE.MathUtils.degToRad(n));p[0].normal.applyQuaternion(d);p[1].normal.applyQuaternion(d);p[2].normal.applyQuaternion(d);p[3].normal.applyQuaternion(d)}let u=e=="triangle"?3:4;for(let e=0;e<u;e++){p[e].userData={originalConstant:p[e].constant,currentConstrain:t?5:p[e].constant,desiredConstant:p[e].constant};if(t){p[e].constant=5}}a.clipPlanes=p;nShapesLeftOutside=0;if(a.pivots){for(let e of a.pivots){if(nShapesLeftOutside<i&&rand(0,1,.01)>.5){nShapesLeftOutside++;continue}for(let t of e.children){if(t.material){t.material.clippingPlanes=a.clipPlanes;t.material.clipIntersection=true}for(let e of t.children){if(e.material){e.material.clippingPlanes=a.clipPlanes;e.material.clipIntersection=true}}}}}}function removeNegativeSpace(t){t.removingNegativeSpace=true;for(let e=0;e<t.clipPlanes.length;e++){if(t.clipPlanes[e].userData){t.clipPlanes[e].userData.desiredConstant=5}}setTimeout(()=>{if(t.pivots){for(let e of t.pivots){for(let t of e.children){if(t.material){t.material.clippingPlanes=[];t.material.needsUpdate=true}for(let e of t.children){if(e.material){e.material.clippingPlanes=[];e.material.needsUpdate=true}}}}}for(let e=0;e<t.clipPlanes.length;e++){SCENE.scene.remove(t.clipPlanes[e])}t.clipPlanes=undefined;delete t.clipPlanes;t.removingNegativeSpace=false},2e4)}function initOBJLoader(){const U=/^[og]\s*(.+)?/;const X=/^mtllib /;const Y=/^usemtl /;const Z=/^usemap /;const _=/\s+/;const r=new THREE.Vector3;const o=new THREE.Vector3;const s=new THREE.Vector3;const l=new THREE.Vector3;const c=new THREE.Vector3;const j=new THREE.Color;function z(){const e={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materials:{},materialLibraries:[],startObject:function(e,t){if(this.object&&this.object.fromDeclaration===false){this.object.name=e;this.object.fromDeclaration=t!==false;return}const a=this.object&&typeof this.object.currentMaterial==="function"?this.object.currentMaterial():undefined;if(this.object&&typeof this.object._finalize==="function"){this.object._finalize(true)}this.object={name:e||"",fromDeclaration:t!==false,geometry:{vertices:[],normals:[],colors:[],uvs:[],hasUVIndices:false},materials:[],smooth:true,startMaterial:function(e,t){const a=this._finalize(false);if(a&&(a.inherited||a.groupCount<=0)){this.materials.splice(a.index,1)}const i={index:this.materials.length,name:e||"",mtllib:Array.isArray(t)&&t.length>0?t[t.length-1]:"",smooth:a!==undefined?a.smooth:this.smooth,groupStart:a!==undefined?a.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:false,clone:function(e){const t={index:typeof e==="number"?e:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:false};t.clone=this.clone.bind(t);return t}};this.materials.push(i);return i},currentMaterial:function(){if(this.materials.length>0){return this.materials[this.materials.length-1]}return undefined},_finalize:function(e){const t=this.currentMaterial();if(t&&t.groupEnd===-1){t.groupEnd=this.geometry.vertices.length/3;t.groupCount=t.groupEnd-t.groupStart;t.inherited=false}if(e&&this.materials.length>1){for(let e=this.materials.length-1;e>=0;e--){if(this.materials[e].groupCount<=0){this.materials.splice(e,1)}}}if(e&&this.materials.length===0){this.materials.push({name:"",smooth:this.smooth})}return t}};if(a&&a.name&&typeof a.clone==="function"){const i=a.clone(0);i.inherited=true;this.object.materials.push(i)}this.objects.push(this.object)},finalize:function(){if(this.object&&typeof this.object._finalize==="function"){this.object._finalize(true)}},parseVertexIndex:function(e,t){const a=parseInt(e,10);return(a>=0?a-1:a+t/3)*3},parseNormalIndex:function(e,t){const a=parseInt(e,10);return(a>=0?a-1:a+t/3)*3},parseUVIndex:function(e,t){const a=parseInt(e,10);return(a>=0?a-1:a+t/2)*2},addVertex:function(e,t,a){const i=this.vertices;const n=this.object.geometry.vertices;n.push(i[e+0],i[e+1],i[e+2]);n.push(i[t+0],i[t+1],i[t+2]);n.push(i[a+0],i[a+1],i[a+2])},addVertexPoint:function(e){const t=this.vertices;const a=this.object.geometry.vertices;a.push(t[e+0],t[e+1],t[e+2])},addVertexLine:function(e){const t=this.vertices;const a=this.object.geometry.vertices;a.push(t[e+0],t[e+1],t[e+2])},addNormal:function(e,t,a){const i=this.normals;const n=this.object.geometry.normals;n.push(i[e+0],i[e+1],i[e+2]);n.push(i[t+0],i[t+1],i[t+2]);n.push(i[a+0],i[a+1],i[a+2])},addFaceNormal:function(e,t,a){const i=this.vertices;const n=this.object.geometry.normals;r.fromArray(i,e);o.fromArray(i,t);s.fromArray(i,a);c.subVectors(s,o);l.subVectors(r,o);c.cross(l);c.normalize();n.push(c.x,c.y,c.z);n.push(c.x,c.y,c.z);n.push(c.x,c.y,c.z)},addColor:function(e,t,a){const i=this.colors;const n=this.object.geometry.colors;if(i[e]!==undefined)n.push(i[e+0],i[e+1],i[e+2]);if(i[t]!==undefined)n.push(i[t+0],i[t+1],i[t+2]);if(i[a]!==undefined)n.push(i[a+0],i[a+1],i[a+2])},addUV:function(e,t,a){const i=this.uvs;const n=this.object.geometry.uvs;n.push(i[e+0],i[e+1]);n.push(i[t+0],i[t+1]);n.push(i[a+0],i[a+1])},addDefaultUV:function(){const e=this.object.geometry.uvs;e.push(0,0);e.push(0,0);e.push(0,0)},addUVLine:function(e){const t=this.uvs;const a=this.object.geometry.uvs;a.push(t[e+0],t[e+1])},addFace:function(e,t,a,i,n,r,o,s,l){const c=this.vertices.length;let f=this.parseVertexIndex(e,c);let p=this.parseVertexIndex(t,c);let d=this.parseVertexIndex(a,c);this.addVertex(f,p,d);this.addColor(f,p,d);if(o!==undefined&&o!==""){const u=this.normals.length;f=this.parseNormalIndex(o,u);p=this.parseNormalIndex(s,u);d=this.parseNormalIndex(l,u);this.addNormal(f,p,d)}else{this.addFaceNormal(f,p,d)}if(i!==undefined&&i!==""){const m=this.uvs.length;f=this.parseUVIndex(i,m);p=this.parseUVIndex(n,m);d=this.parseUVIndex(r,m);this.addUV(f,p,d);this.object.geometry.hasUVIndices=true}else{this.addDefaultUV()}},addPointGeometry:function(a){this.object.geometry.type="Points";const i=this.vertices.length;for(let e=0,t=a.length;e<t;e++){const n=this.parseVertexIndex(a[e],i);this.addVertexPoint(n);this.addColor(n)}},addLineGeometry:function(a,i){this.object.geometry.type="Line";const n=this.vertices.length;const r=this.uvs.length;for(let e=0,t=a.length;e<t;e++){this.addVertexLine(this.parseVertexIndex(a[e],n))}for(let e=0,t=i.length;e<t;e++){this.addUVLine(this.parseUVIndex(i[e],r))}}};e.startObject("",false);return e}class e extends THREE.Loader{constructor(e){super(e);this.materials=null}load(a,i,e,n){const r=this;const t=new THREE.FileLoader(this.manager);t.setPath(this.path);t.setRequestHeader(this.requestHeader);t.setWithCredentials(this.withCredentials);t.load(a,function(e){try{i(r.parse(e))}catch(t){if(n){n(t)}else{}r.manager.itemError(a)}},e,n)}setMaterials(e){this.materials=e;return this}parse(e){const i=new z;if(e.indexOf("\r\n")!==-1){e=e.replace(/\r\n/g,"\n")}if(e.indexOf("\\\n")!==-1){e=e.replace(/\\\n/g,"")}const a=e.split("\n");let n=[];for(let e=0,t=a.length;e<t;e++){const o=a[e].trimStart();if(o.length===0)continue;const s=o.charAt(0);if(s==="#")continue;if(s==="v"){const l=o.split(_);switch(l[0]){case"v":i.vertices.push(parseFloat(l[1]),parseFloat(l[2]),parseFloat(l[3]));if(l.length>=7){j.setRGB(parseFloat(l[4]),parseFloat(l[5]),parseFloat(l[6])).convertSRGBToLinear();i.colors.push(j.r,j.g,j.b)}else{i.colors.push(undefined,undefined,undefined)}break;case"vn":i.normals.push(parseFloat(l[1]),parseFloat(l[2]),parseFloat(l[3]));break;case"vt":i.uvs.push(parseFloat(l[1]),parseFloat(l[2]));break}}else if(s==="f"){const c=o.slice(1).trim();const f=c.split(_);const p=[];for(let e=0,t=f.length;e<t;e++){const u=f[e];if(u.length>0){const m=u.split("/");p.push(m)}}const d=p[0];for(let e=1,t=p.length-1;e<t;e++){const g=p[e];const h=p[e+1];i.addFace(d[0],g[0],h[0],d[1],g[1],h[1],d[2],g[2],h[2])}}else if(s==="l"){const E=o.substring(1).trim().split(" ");let a=[];const S=[];if(o.indexOf("/")===-1){a=E}else{for(let e=0,t=E.length;e<t;e++){const v=E[e].split("/");if(v[0]!=="")a.push(v[0]);if(v[1]!=="")S.push(v[1])}}i.addLineGeometry(a,S)}else if(s==="p"){const c=o.slice(1).trim();const x=c.split(" ");i.addPointGeometry(x)}else if((n=U.exec(o))!==null){const T=(" "+n[0].slice(1).trim()).slice(1);i.startObject(T)}else if(Y.test(o)){i.object.startMaterial(o.substring(7).trim(),i.materialLibraries)}else if(X.test(o)){i.materialLibraries.push(o.substring(7).trim())}else if(Z.test(o)){}else if(s==="s"){n=o.split(" ");if(n.length>1){const A=n[1].trim().toLowerCase();i.object.smooth=A!=="0"&&A!=="off"}else{i.object.smooth=true}const b=i.object.currentMaterial();if(b)b.smooth=i.object.smooth}else{if(o==="\0")continue}}i.finalize();const r=new THREE.Group;r.materialLibraries=[].concat(i.materialLibraries);const t=!(i.objects.length===1&&i.objects[0].geometry.vertices.length===0);if(t===true){for(let t=0,e=i.objects.length;t<e;t++){const w=i.objects[t];const R=w.geometry;const y=w.materials;const D=R.type==="Line";const C=R.type==="Points";let a=false;if(R.vertices.length===0)continue;const N=new THREE.BufferGeometry;N.setAttribute("position",new THREE.Float32BufferAttribute(R.vertices,3));if(R.normals.length>0){N.setAttribute("normal",new THREE.Float32BufferAttribute(R.normals,3))}if(R.colors.length>0){a=true;N.setAttribute("color",new THREE.Float32BufferAttribute(R.colors,3))}if(R.hasUVIndices===true){N.setAttribute("uv",new THREE.Float32BufferAttribute(R.uvs,2))}const M=[];for(let t=0,e=y.length;t<e;t++){const P=y[t];const O=P.name+"_"+P.smooth+"_"+a;let e=i.materials[O];if(this.materials!==null){e=this.materials.create(P.name);if(D&&e&&!(e instanceof THREE.LineBasicMaterial)){const F=new THREE.LineBasicMaterial;THREE.Material.prototype.copy.call(F,e);F.color.copy(e.color);e=F}else if(C&&e&&!(e instanceof THREE.PointsMaterial)){const H=new THREE.PointsMaterial({size:10,sizeAttenuation:false});THREE.Material.prototype.copy.call(H,e);H.color.copy(e.color);H.map=e.map;e=H}}if(e===undefined){if(D){e=new THREE.LineBasicMaterial}else if(C){e=new THREE.PointsMaterial({size:1,sizeAttenuation:false})}else{e=new THREE.MeshPhongMaterial({color:"#000000"})}e.name=P.name;e.flatShading=P.smooth?false:true;e.vertexColors=a;i.materials[O]=e}M.push(e)}let e;if(M.length>1){for(let e=0,t=y.length;e<t;e++){const P=y[e];N.addGroup(P.groupStart,P.groupCount,e)}if(D){e=new THREE.LineSegments(N,M)}else if(C){e=new THREE.Points(N,M)}else{e=new THREE.Mesh(N,M)}}else{if(D){e=new THREE.LineSegments(N,M[0])}else if(C){e=new THREE.Points(N,M[0])}else{e=new THREE.Mesh(N,M[0])}}e.name=w.name;r.add(e)}}else{if(i.vertices.length>0){const b=new THREE.PointsMaterial({size:1,sizeAttenuation:false});const N=new THREE.BufferGeometry;N.setAttribute("position",new THREE.Float32BufferAttribute(i.vertices,3));if(i.colors.length>0&&i.colors[0]!==undefined){N.setAttribute("color",new THREE.Float32BufferAttribute(i.colors,3));b.vertexColors=true}const k=new THREE.Points(N,b);r.add(k)}}return r}}THREE.OBJLoader=e}function initImprovedNoise(){const T=[151,160,137,91,90,15,131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23,190,6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33,88,237,149,56,87,174,20,125,136,171,168,68,175,74,165,71,134,139,48,27,166,77,146,158,231,83,111,229,122,60,211,133,230,220,105,92,41,55,46,245,40,244,102,143,54,65,25,63,161,1,216,80,73,209,76,132,187,208,89,18,169,200,196,135,130,116,188,159,86,164,100,109,198,173,186,3,64,52,217,226,250,124,123,5,202,38,147,118,126,255,82,85,212,207,206,59,227,47,16,58,17,182,189,28,42,223,183,170,213,119,248,152,2,44,154,163,70,221,153,101,155,167,43,172,9,129,22,39,253,19,98,108,110,79,113,224,232,178,185,112,104,218,246,97,228,251,34,242,193,238,210,144,12,191,179,162,241,81,51,145,235,249,14,239,107,49,192,214,31,181,199,106,157,184,84,204,176,115,121,50,45,127,4,150,254,138,236,205,93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180];for(let e=0;e<256;e++){T[256+e]=T[e]}function b(e){return e*e*e*(e*(e*6-15)+10)}function A(e,t,a){return t+e*(a-t)}function w(e,t,a,i){const n=e&15;const r=n<8?t:a,o=n<4?a:n==12||n==14?t:i;return((n&1)==0?r:-r)+((n&2)==0?o:-o)}class e{noise(e,t,a){const i=Math.floor(e),n=Math.floor(t),r=Math.floor(a);const o=i&255,s=n&255,l=r&255;e-=i;t-=n;a-=r;const c=e-1,f=t-1,p=a-1;const d=b(e),u=b(t),m=b(a);const g=T[o]+s,h=T[g]+l,E=T[g+1]+l,S=T[o+1]+s,v=T[S]+l,x=T[S+1]+l;return A(m,A(u,A(d,w(T[h],e,t,a),w(T[v],c,t,a)),A(d,w(T[E],e,f,a),w(T[x],c,f,a))),A(u,A(d,w(T[h+1],e,t,p),w(T[v+1],c,t,p)),A(d,w(T[E+1],e,f,p),w(T[x+1],c,f,p))))}}THREE.ImprovedNoise=e}function stringToHexadecimal(t){let a="";for(let e=0;e<t.length;e++){const i=t.charCodeAt(e).toString(16);a+=("00"+i).slice(-2)}return a}async function callProvider(e){callPayload={method:"POST",body:JSON.stringify(e)};let a;for(let t=0;t<NODE_URLS.length;t++){for(let e=0;e<2;e++){try{a=await fetch(NODE_URLS[t],callPayload);if(a.ok){let e=await a.json();return e}else{}}catch(i){await new Promise(e=>setTimeout(e,2e3))}}}}async function getLastBlockReceipts(t){let e=await callProvider({method:"eth_blockNumber",params:[],id:2,jsonrpc:"2.0"});let a=await callProvider({method:"eth_getBlockReceipts",params:[e.result],id:2,jsonrpc:"2.0"});for(let e of a.result){if(t=="ANYWALLET"){const i=JSON.stringify(e,null,2);return i}if(t.indexOf(e.from)>-1||t.indexOf(e.to)>-1){const i=JSON.stringify(e,null,2);return i}}}async function receiptsWrapper(){try{await getLastBlockReceipts()}catch(e){}}async function getContractData(){for(let t=0;t<NODE_URLS.length;t++){for(let e=0;e<2;e++){try{var a=await fetch(NODE_URLS[t],{method:"POST",body:JSON.stringify({method:"eth_call",params:[{to:contractAddress,data:jsonRpcCallDataContract},"latest"],id:2,jsonrpc:"2.0"})});if(a.ok){let e=await a.json();let t=hexToArray(e.result);try{t=splitArray(t,[1,200,1,200,1,400,400,1,300])}catch(i){t=splitArray(t,[1,200,1,200,1,400,400,1])}return t}else{}}catch(i){await new Promise(e=>setTimeout(e,2e3))}}}}function hexToUnicode(e){let t=e.match(/.{1,2}/g)||[];let a=t.map(e=>String.fromCharCode(parseInt(e,16)));let i=a.join("");return i.replace(/\u0000/g,"")}function hexToArray(e){const t=e.slice(2);const a=[];for(let e=0;e<t.length;e+=64){if(e>=77200){const i=hexToUnicode(t.slice(e,e+128),16);if(i.length>=37&&i[0]==0){a.push(i)}}else{const n=parseInt(t.slice(e,e+64),16);a.push(n)}}return a}function splitArray(t,a){const i=[];let n=0;for(let e=0;e<a.length;e++){const r=a[e];const o=t.slice(n,n+r);i.push(o);n+=r}if(n<t.length){const e=t.slice(n);i.push(e)}return i}function getCurrentTs(){return(new Date).getTime()/1e3}function generateUUID(){return"xyxxyxxxyxxyxx".replace(/[xy]/g,function(e){var t=Math.random()*16|0,a=e=="x"?t:t&3|8;return a.toString(16)})}