Hi specklers,
I have been following Speckle since the beginning. It’s incredible what you have achieved. Kudos to all of you!
Actually we do have a little bit of a common history. @dmitry remember our brainstorming end of 2015 when we had just founded ShapeDiver? And special thanks to @Pavol for working with us along the way.
At ShapeDiver we have been pondering about establishing a connector to Speckle since a long time, now it’s time to finally get the ball rolling. Here are our initial thoughts, looking forward to your feedback and ideas.
Motivation
Connecting ShapeDiver with Speckle will enable use cases like the following ones.
Use case 1 - Feed data from Speckle into ShapeDiver
Get data from Speckle streams into Grasshopper models running on ShapeDiver. Imagine the model has a text input called Speckle stream URL. When interacting with a model on the ShapeDiver Platform, users can paste their Speckle URLs (pointing to specific branches or commits) and trigger computations of the model which read data from the stream.
Use case 2 - Feed data from ShapeDiver to Speckle
Export data from ShapeDiver to Speckle. This could be done as part of any computation of a ShapeDiver model using Speckle’s Grasshopper plugin. As an example, the results of an online configurator can be pushed to Speckle streams. Use cases 1 and 2 can be combined to achieve a workflow that gets data out and back into Speckle in a single step. Depending on the specific application, the fact that Speckle is used could be hidden from the end user.
Use case 3 - Speckle bots
Create bots that run automatically based on events happening in Speckle. Imagine a bot that runs some analysis tasks or creates some geometry in Grasshopper based on every commit sent to a specific branch of a Speckle stream. The results can be pushed again to the same or another Speckle stream.
Eventually, this can orchestrate several processing steps into a complete workflow or pipeline.
Idea for implementation
Quite some technical details here, but it would be great to have your thoughts on them as well.
-
Deploy the Speckle Grasshopper plugin to ShapeDiver’s Geometry Backend systems. Some components may not make sense or pose security risks and must be deactivated on ShapeDiver. This needs to be reviewed but should only be a minor issue.
Speckle’s Send nodes need to have auto-sending switched on because there is no way to click the Send button when running Grasshopper models on ShapeDiver. The Receive node should have auto-receiving switched off. Ideally, the Speckle stream URLs would be fed into the model using ShapeDiver’s Direct text input components, allowing a model to react to different streams.
This implementation step enables use cases 1 and 2 described above. -
Set up a microservice to trigger computations of ShapeDiver models based on Speckle webhook calls. This microservice should allow users of ShapeDiver to set up Webhook receiver URLs, which identify the ShapeDiver model to call and the credentials to use. The microservice must also know the optional secret specified for the Speckle webhook.
Every time a Webhook receiver URL is called by a Speckle webhook, the following happens:- Verify the webhook call using the secret.
- Open a session with the ShapeDiver model identified by the Speckle webhook receiver URL, inspect the parameters defined by the model, and match them to the properties of the Speckle webhook payload. Some examples:
- A text input called
streamId
would be matched to thestreamId
property of the payload. - A text input called
event.event_name
would be matched to theevent.event_name
property of the payload. - A text input called
payload
would be matched to the complete webhook payload, which can be decomposed in Grasshopper using JSON components.
- A text input called
- Trigger the computation. It needs to be clarified whether the microservice should wait for the computation to finish or return immediately. Whether waiting makes sense depends on the expected computation time. Long computation times can lead to trouble with HTTP timeouts, and waiting for them would also significantly increase the cost when running the microservice on Lambda.
-
Speckle’s Send node can send data back to Speckle from the Grasshopper model running on ShapeDiver, i.e., it seems there is no need for a webhook the other way around. The stream URL could be configured using a text input.
This will be amazing, I can’t wait to see this working