Accessing RhinoDoc from Rhino Compute production server

Hi all. How do you access RhinoDoc objects from within a .gh file on a Compute production server?

So far I have a number of the pieces working locally, but I am stuck porting this over to production.

How I think it should work:

  • save the .3dm file to a temp directory on the Compute server
  • pass the path of that file into the .gh file via RH_IN
  • use RhinoDoc.OpenHeadless(path) to access the RhinoDoc object

The part I am stuck on is saving the .3dm to temp storage. I already have these files hosted, but I am not sure what the best way to get them onto the Compute server. Any help is appreciated.

After thinking about this more, it seems like the most straightforward solution is to spin up a Node.js instance alongside Rhino Compute on the production server. I can have an endpoint that downloads the .3dm file to a temp directory and upon completion, it returns the path back to the requestor, which fires off the Compute process.

This seems a bit convoluted. Any other thoughts?

@will, @fraguada - is this something you can help with?

Hey @user389, I’d recommend taking a look at the ComputePlugIn sample.

Hi Will,

This is a great example. Very similar to what I’ve done. When running node.js alongside rhino.compute, what is the best practice? Do you typically handle web traffic through node, then route that to rhino.compute locally (like a sudo reverse proxy)? That looks like how it’s being handled in this sample.

Thanks,
Oliver

In the example, everything is handled by Rhino Compute via the endpoints exposed by the plug-in. The javascript code is just a script that shows how a client might call these endpoints.