Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: "Cannot read '0' at undefined compute'" #76

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/examples/panels/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ async function compute(){
document.getElementById('loader').style.display = 'none'

// process mesh
let mesh_data = JSON.parse(responseJson.values[0].InnerTree['{ 0; }'][0].data)
let mesh_data = JSON.parse(responseJson.values[0].InnerTree['{0}'][0].data)
let mesh = rhino.CommonObject.decode(mesh_data)

if (!_threeMaterial) {
Expand All @@ -82,11 +82,11 @@ async function compute(){
replaceCurrentMesh(threeMesh)

//process data
let cluster_data = responseJson.values[1].InnerTree['{ 0; }'].map(d=>d.data)
let cluster_data = responseJson.values[1].InnerTree['{0}'].map(d=>d.data)
console.log(cluster_data)

//process colors
let color_data = responseJson.values[2].InnerTree['{ 0; }'].map( d=> {
let color_data = responseJson.values[2].InnerTree['{0}'].map( d=> {

return 'rgb(' + JSON.parse(d.data) + ')'

Expand Down
2 changes: 1 addition & 1 deletion src/examples/spikyThing/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ async function compute(){

// hide spinner
document.getElementById('loader').style.display = 'none'
let data = JSON.parse(responseJson.values[0].InnerTree['{ 0; }'][0].data)
let data = JSON.parse(responseJson.values[0].InnerTree['{0}'][0].data)
let mesh = rhino.DracoCompression.decompressBase64String(data)

t1 = performance.now()
Expand Down