Custom gh file doesn't work on local compute.rhino3d

Hello,

I have ran the compute.rhino3d /view examples successfully and everything works.
Now I want to try some simple custom .gh file but it gives me error.

Uncaught (in promise) TypeError: Cannot read properties of null (reading 'objects')
    at decodeObjects (VM3 d8b1a10c-5a11-41…-874ab3555bea:88:18)
    at VM3 d8b1a10c-5a11-41…-874ab3555bea:62:17

It seems that doc.objects() is returning null. But manually sending GET request to the http://localhost:3000/solve/fatbox.gh?height=100&width=100 endpoint seems to return well.

Can you try running my simple .gh code?

fatbox.gh (5.3 KB)

The def works fine through hops, so something is tripping up the appserver. I will look into it.

1 Like

Thank you!
I’ve been stuck on this for the last two weeks.

The issue seems to be with the version of rhino3dm.js used by this endpoint in the appserver. Updating it to 7.14.0 seems to fix it:

in src>views>definitions.hbs lines 63 and 67

I will push the changes to the appserver, but the change is pretty simple to do yourself so you can keep going. Sorry you got caught up by this!

Hello Mr.Luis,

Thank you for updating on this issue.
As you suggestion, I have manually fixed the definition.hbs in lines 63 and 67, and it shows the mesh on the web.

But when I changed the slider value, it’s shows this error:

THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.

Thus I’ve forked the updated repo, but it is still gives me an error of “Internal Server Issue”.

I’ve noticed that appserver is calling the .gh files with 0 values even though I’ve set the slider min value larger than 0?

As you can see, it calls the file with the default value of 0.

This is the gh file.
simpleboxtest.gh (5.4 KB)

Setting the minimum and maximum in the context input seems to fix this issue for me:

image


simpleboxtest_mod.gh (8.1 KB)

1 Like

This is working now, I didn’t know the max and min limit of the get input doesn’t inherit the slider’s max and min input.
I will be using this more carefully then.

Thank you very much for your help.

Kind regards,
Amaraa.

1 Like