{"success":true,"parcel":{"id":4902,"height":16,"token":null,"name":" Autoscintillator II / Cat Driving School Testing Site","traffic_visits":5635,"address":"13 Kind Fork","visible":true,"geometry":{"crs":{"type":"name","properties":{"name":"EPSG:3857"}},"type":"Polygon","coordinates":[[[-66.93,-0.59],[-67.01,-0.59],[-67.01,-0.390100003],[-66.93,-0.390100003],[-66.93,-0.59]]]},"distance_to_center":6693.11,"distance_to_closest_common":341.01,"distance_to_ocean":23,"x1":-6701,"x2":-6693,"y1":0,"y2":16,"z1":-59,"z2":-39,"suburb":"Vibes","is_common":false,"owner":{"id":"019e38a7-93a2-72d1-bd29-712ca1b5cd35","name":"NinjaNode","owner":"0xa8e162b7d258160f973449c2532234c361586dd4","created_at":null},"updated_at":"2023-12-07T18:16:40.697Z","parcel_users":[{"id":"019e38a7-96df-79da-b56a-f290bfda6e39","name":"Felirami","role":"contributor","owner":"0x281e6843cc18c8d58ee131309f788879f6c18d10","created_at":"2021-04-02T03:17:12.636171"},{"id":"019e38a7-9721-7924-8906-dfb0640df874","name":"meownow","role":"owner","owner":"0x450eb7c423a9ccb91939f340948e48de9bb55865","created_at":"2021-05-07T15:52:23.38909"},{"id":"019e38a7-935b-75c5-9cf1-96348ee775fd","name":"jessytsuki.eth","role":"contributor","owner":"0x54de602b061129632a0d2605e05833b6beda2172","created_at":null},{"id":"019e38a7-94e1-702f-b951-660ece5b57c0","name":"QountQuteness","role":"contributor","owner":"0x56fa492b222ec80652342338bbe7e2e31ed355ab","created_at":null},{"id":"019e38a7-862e-7d0c-9b5e-86a056a1bad5","name":"LiquidChicken","role":"contributor","owner":"0x81f8e31dd6da93b68c61268d15ce0b878039bfba","created_at":null},{"id":"019e38a7-93a2-72d1-bd29-712ca1b5cd35","name":"NinjaNode","role":"contributor","owner":"0xa8e162b7d258160f973449c2532234c361586dd4","created_at":null},{"id":"019e38a7-9786-7332-ba5c-11807071d348","name":"SlyNode","role":"contributor","owner":"0xe54f0fcad9b7c61ced45ec30fcd6303511a48ba1","created_at":"2021-04-19T07:55:47.145173"}],"label":"","description":null,"lightmap_url":null,"content":{"voxels":"eJzt1kERgEAAxDDOOdIxwXTvkdREz3uu7gEA4Ffrv/N/AACt9d/5PwCA1vrv/B8AQGv9d/4PAKC1/jv/BwDQWv+d/wMAaK3/zv8BALTWf+f/AABa67/zfwAArfXf+T8AgNb67/wfAEBr/Xf+DwCgtf47/wcA0Fr/nf8DAGit/87/AQC0PpZUhR8=","features":[{"url":"","type":"cube","uuid":"41236692-dece-4df1-9592-5dd3b8ccc3bb","scale":[0.5,0.5,0.5],"script":"//let script_log1 = parcel.getFeatureById('script_log1');\nlet tokenURI = \"https://www.cryptovoxels.com/p/\" + parcel.id;\nlet pLength = 0;\nlet pWidth = 0;\nlet pHeight = 0;\n\nfetch('https://api.thegraph.com/subgraphs/name/protofire/cryptovoxels', {\n\tmethod: 'POST',\n\theaders: {\n\t\t'Content-Type': 'application/json',\n\t},\n  body: JSON.stringify({\n  \tquery: `\n    \tquery MyQuery {\n      parcels(first: 1, where: {tokenURI: \"${tokenURI}\" }) {\n      id\n      tokenID\n      location\n      buildHeight\n      area\n      length\n      width\n      volumeInVoxels\n      owner {\n      \tid\n      }\n      createdAt\n      tokenURI\n       }\n      }\n    `,\n    })\n  })\n\t.then((res) => res.json())\n  .then((result) => {\n//\t\tconsole.log(result.data);\n\t\tpLength = result.data.parcels[0].length;\n\t\tpWidth = result.data.parcels[0].width;\n    pHeight = result.data.parcels[0].buildHeight;\n\t\tconsole.log(pLength);\n\t\tconsole.log(pWidth);\n    console.log(pHeight);\n\n\nlet max_height =  pHeight + 40;\nlet offSet = .1;\nlet elementHeight = .15;\nlet elementSpacing = .15;\nlet timeShift = 2;\nlet altD = 0.5;\n\n\nlet max_colors = 400;\nlet colors = [];\nfor (let i=1; i < max_colors + 1; i++) {\n  colors.push(rainbow(max_colors, i));\n}\n\n//9, 1, 0.33, 0.5, 0.5, 8\n//-8.5, 1, 0.33, 0.5, 0.5, 8\n//0.25, 1, 4, 17 0.5 0.5\n\n//13 Kind Fork\n//4, 1, 0.25 20\n//-3.5, 1, 0.25\n//0.25, 1, -9.5\n//0.25, 1, 10\n\nlet westX = (pLength / 2) * (-1) + altD;\nlet westY = 1;\nlet westZ = 0.45;\nlet eastX = pLength / 2;\nlet eastY = 1;\nlet eastZ = 0.45;\nlet weSZ = pWidth - 0.5;\n\nlet northX = 0.25;\nlet northY = 1;\nlet northZ = pWidth / 2;\nlet southX = 0.25;\nlet southY = 1;\nlet southZ = (pWidth / 2) * (-1) + altD;\nlet nsSZ = pLength;\n\n\n\n\nlet wWalls = [];\nlet nWalls = [];\nlet eWalls = [];\nlet sWalls = [];\nlet localSpacing = elementSpacing;\nlet newFeature = null;\nfor (i=max_height;i>-1;i--) {\n  //if (i < (max_height)) { localSpacing = elementSpacing; } else { localSpacing = 0; }\n  console.log(localSpacing);\n  newFeature = parcel.createFeature('cube');\n  newFeature.set({color: '#000000'});\n  newFeature.set({scale:[altD,elementHeight,weSZ]});\n  newFeature.set({position:[westX,offSet + ((elementHeight + localSpacing) * i),westZ]});\n  newFeature.set({collidable: true});\n  newFeature.set({id: cvFeatureId('wWall', i) });\n  //script_log1.set({text: newFeature.id});\n  wWalls.push(newFeature);\n\n  newFeature = parcel.createFeature('cube');\n  newFeature.set({color: '#000000'});\n  newFeature.set({scale:[nsSZ,elementHeight,altD]});\n  newFeature.set({position:[northX,offSet + ((elementHeight + localSpacing) * i),northZ]});\n  newFeature.set({collidable: true});\n  newFeature.set({id: cvFeatureId('nWall', i) });\n  //script_log1.set({text: newFeature.id});\n  nWalls.push(newFeature);\n\n  newFeature = parcel.createFeature('cube');\n  newFeature.set({color: '#000000'});\n  newFeature.set({scale:[altD,elementHeight,weSZ]});\n  newFeature.set({position:[eastX,offSet + ((elementHeight + localSpacing) * i),eastZ]});\n  newFeature.set({collidable: true});\n  newFeature.set({id: cvFeatureId('eWall', i) });\n  //script_log1.set({text: newFeature.id});\n  eWalls.push(newFeature);\n\n  newFeature = parcel.createFeature('cube');\n  newFeature.set({color: '#000000'});\n  newFeature.set({scale:[nsSZ,elementHeight,altD]});\n  newFeature.set({position:[southX,offSet + ((elementHeight + localSpacing) * i),southZ]});\n  newFeature.set({collidable: true});\n  newFeature.set({id: cvFeatureId('sWall', i) });\n  //script_log1.set({text: newFeature.id});\n  sWalls.push(newFeature);\n  //console.log(i);\n}\n\n\nlet lwWall = null;\nlet lnWall = null;\nlet leWall = null;\nlet lsWall = null;\nlet lColor = null;\nsetInterval(()=>{\n  lwWall = wWalls.pop();\n  lnWall = nWalls.pop();\n  leWall = eWalls.pop();\n  lsWall = sWalls.pop();\n  lColor = colors.pop();\n  lwWall.set({ color: lColor});\n  lnWall.set({ color: lColor});\n  leWall.set({ color: lColor});\n  lsWall.set({ color: lColor});\n//script_log1.set({text: lColor});\n//script_log1.set({text: lwWall.id});\n  wWalls.unshift(lwWall);\n  nWalls.unshift(lnWall);\n  eWalls.unshift(leWall);\n  sWalls.unshift(lsWall);\n  colors.unshift(lColor);\n}, timeShift);\n\n});\n\nfunction cvFeatureId(name, number) {\n  return name + number.toString().padStart(2,'0');\n}\n\nfunction rainbow(numOfSteps, step) {\n    // based on http://stackoverflow.com/a/7419630\n    // This function generates vibrant, \"evenly spaced\" colours (i.e. no clustering). This is ideal for creating easily distiguishable vibrant markers in Google Maps and other apps.\n    // Adam Cole, 2011-Sept-14\n    // HSV to RBG adapted from: http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript\n    var r, g, b;\n    var h = step / numOfSteps;\n    var i = ~~(h * 6);\n    var f = h * 6 - i;\n    var q = 1 - f;\n    switch(i % 6){\n        case 0: r = 1, g = f, b = 0; break;\n        case 1: r = q, g = 1, b = 0; break;\n        case 2: r = 0, g = 1, b = f; break;\n        case 3: r = 0, g = q, b = 1; break;\n        case 4: r = f, g = 0, b = 1; break;\n        case 5: r = 1, g = 0, b = q; break;\n    }\n\n    var c = \"#\" + (\"00\" + (~ ~(r * 235)).toString(16)).slice(-2) + (\"00\" + (~ ~(g * 235)).toString(16)).slice(-2) + (\"00\" + (~ ~(b * 235)).toString(16)).slice(-2);\n    return (c);\n}\n","version":"40113","position":[0.5,1,9],"rotation":[-0.025,0,0]}]},"settings":{"sandbox":false,"hosted_scripts":false,"script_host_url":"wss://grid.cryptovoxels.com/grid/4902"},"island":"Vibes","kind":"plot","minted":true,"sandbox":false}}