Rendering objects on Web/Extension

Hi Speckle Team,
I have followed the SpecklePy docs example - created a (custom) Block, transported it to the server, serialized it and committed it. It all works like a charm. The thing i am confused about is that the Block does not show with data/preview on the stream webpage, why is that? Also when i try to receive it from the Rhino Speckle extensions.
Heard something about that it needs to be a “default” object like Mesh to work on different platforms, but what are the geometry then used for?
Ultimately i want to create a Block/Box in SpecklePy, send it to the Speckle server and then receive it with the Rhino extensions.
Thanks in advance.

Hi karlos,
the same happened yesterday to me and I was very confused.
The Block class which you define in the tutorial has no geometry. The viewer can not display it since it has not displayValue from my understanding.
Just use the Box Class from the objects library instead.

I am sure the Speckle Team can elaborate more on that.

Best,
Vinzenz

1 Like

@karlos and @VinzenzTrimborn, you’ve touched upon a fundamental aspect of Speckle’s design. All objects in Speckle can indeed be categorized into two main aspects:

  1. Object Definition: a. Generic definition, like a Wall. b. Specific definition from a particular application, such as RevitWall.
  2. Fallback Display Component: This is crucial for interoperability across different applications.

In Speckle, if you extend your object schemas from the ObjectsKit, your application should seamlessly convert between your custom schema and Speckle’s standard format, and vice versa.

The fallback mechanism typically goes from specific (1b) to generic (1a) for wider application compatibility. If neither is applicable, Speckle resorts to the displayValue, which is often a Mesh, Line, Text, or other primitive.

When you’re working with a Box element in SpecklePy and sending it to Speckle, it should ideally translate into an equivalent Box in applications like Revit, Grasshopper, or Rhino. However, the Speckle Web viewer does not have specialized logic to interpret a Box directly. Instead, it displays the fallback representation, which is usually a Mesh or a Line.

To ensure better visualization, when sending a Box to Speckle, add a displayValue property to it. This property should contain an array (a single element) of Mesh representing the Box. This way, you can expect a more accurate representation in the Speckle Web viewer and when receiving the object in applications like Rhino.

If you need a step-by-step guide on setting up displayValue or encounter any specific issues, please don’t hesitate to ask. We’re here to help you integrate your custom objects seamlessly into the Speckle ecosystem.

1 Like