Problems with some examples for Rhino.Compute/appserver

Hi @stevebaer , @fraguada , @will
first of all, thanks for the amazing work done with the appserver and rhino.compute!

I’m having problems to visualize some of the examples shared for compute.Rhino3D.appserver. I’ve cloned the github repo today following instalation notes, and I have runned “npm i” to install all dependencies…

It seems to happen only with models that need to represent a mesh: Delaunay, metaballTable,bendy, works apparently fine, but instead “spikyThing”, “panels” connect to Rhino.compute but failed to render the three.js geometry… Please, watch the video below:


from chrome console:
image
from spikyThing “script.js” file:

would appreciate some help solving this problem, I have tried to debug it myself, but i’m not very familiar with all this rhino.compute thing… Seems that rhino.compute is not sending back computed data correctly, but just guessing…
thanks

1 Like

Are you getting any errors logged to the console where conpute.geometry.exe is running?

Nop, rhino.compute’s console doesn’t throw any error message…

Rhino 7 SR5 2021-4-6 (Rhino 7, 7.5.21096.11001, Git hash:master @ 4cd1d638a2f2d3bb193441ecfc1e54559d092807)
License type: Commercial, build 2021-04-06
License details: Cloud Zoo

Windows 10.0.19042 SR0.0 or greater (Physical RAM: 32Gb)

Computer platform: LAPTOP - Plugged in [100% battery remaining]

Non-hybrid graphics configuration.
Primary display and OpenGL: NVIDIA Quadro RTX 5000 (NVidia) Memory: 16GB, Driver date: 11-20-2020 (M-D-Y). OpenGL Ver: 4.6.0 NVIDIA 452.66
> Integrated accelerated graphics device with 4 adapter port(s)
- Secondary monitor is laptop’s integrated screen or built-in port
- Windows Main Display attached to adapter port #1

OpenGL Settings
Safe mode: Off
Use accelerated hardware modes: On
Redraw scene when viewports are exposed: On

Anti-alias mode: 4x
Mip Map Filtering: Linear
Anisotropic Filtering Mode: High

Vendor Name: NVIDIA Corporation
Render version: 4.6
Shading Language: 4.60 NVIDIA
Driver Date: 11-20-2020
Driver Version: 27.21.14.5266
Maximum Texture size: 32768 x 32768
Z-Buffer depth: 24 bits
Maximum Viewport size: 32768 x 32768
Total Video Memory: 16 GB

Rhino plugins that do not ship with Rhino
C:\Program Files\Geometry Gym\Rhino7\ggRhinoIFC.rhp “ggRhinoIFC” 2.1.12.0

Rhino plugins that ship with Rhino
C:\Program Files\Rhino 7\Plug-ins\Commands.rhp “Commands” 7.5.21096.11001
C:\Program Files\Rhino 7\Plug-ins\rdk.rhp “Renderer Development Kit”
C:\Program Files\Rhino 7\Plug-ins\RhinoRenderCycles.rhp “Rhino Render” 7.5.21096.11001
C:\Program Files\Rhino 7\Plug-ins\rdk_etoui.rhp “RDK_EtoUI” 7.5.21096.11001
C:\Program Files\Rhino 7\Plug-ins\rdk_ui.rhp “Renderer Development Kit UI”
C:\Program Files\Rhino 7\Plug-ins\NamedSnapshots.rhp “Snapshots”
C:\Program Files\Rhino 7\Plug-ins\RhinoCycles.rhp “RhinoCycles” 7.5.21096.11001
C:\Program Files\Rhino 7\Plug-ins\Toolbars\Toolbars.rhp “Toolbars” 7.5.21096.11001
C:\Program Files\Rhino 7\Plug-ins\3dxrhino.rhp “3Dconnexion 3D Mouse”
C:\Program Files\Rhino 7\Plug-ins\Displacement.rhp “Displacement”

Do you see the same behaviour when you go to https://compute-rhino3d-appserver.herokuapp.com/examples/spikyThing/?

Try opening the dev tools and go to the “Network” tab, then reload the page. Click the “solve” request to see what the response was from the appserver.

Thank for your attention, @will ,
running it from heroku.app displays the 3d model correctly.


let me share the responses, both from heroku and from local serverheroku.txt (121.0 KB) localServer.txt (121.1 KB)

I noticed two differences when comparing side by side.

I make it run adjusting the code a little bit. I don’t understand why the github code uses this

but getting rid of the semicolon and white spaces at { 0; } made it work here.

i’m aware tha this is purely javascript/VScode thing (which certainly is a context where I have not much experience… so, do you know if this could be related to a missing vscode package or node module from my part? what is the purpose of that semicolon? thanks

1 Like

it worked the same way in both “spikyThing” and “panels”

The '{ 0; }' is because the variable being accessed is a javascript object and has a property named '{ 0; }'. For example:

const obj = { foo: true, bar: false, '{ 0; }': null }
console.log( obj['foo'] ) //should print true
console.log( obj.bar ) //should print false
console.log( obj[ '{ 0; }' ] ) //should print null

Where did you find the code you refer to? It should fail if it the { 0; } isn’t encased in quotes since it is referring to the name of a property.

You can also check the object itself to see its data structure by doing something like:
console.log( responseJson ). This should show you all of the object properties, including those which might have such a name like '{ 0; }'
It also could be the case that something changed in the RhinoCompute response that means that the resulting object no longer has a semicolon.

thank @fraguada , yes I solved my issue printing to console the compute response and observing that the property name was “0” instead of " 0; ".


I downloaded the rhino compute version from here following the steps that @will showed in the Core Workshop in November.
Rhino App Server was also cloned using git, following github instructions

In fact, the response to heroku is " 0: " while my local rhinocompute is responding without white spaces nor semicolons (you can checks this in the txt. files I shared in a previous post, responding to @will)

Problem solved from my part, but yeah, apparently something has been changed in the last rhino.compute master.

thanks

1 Like

Ah, the behaviour changed after I fixed a different bug…

We ought to update the examples to use the new paths (or not rely on the path or its serialised form). Sorry @aitorleceta for taking a while to figure it out and thanks for letting us know about this!

Feel free to submit a pull request if you’ve already patched this on your end :slight_smile:

2 Likes