When the same geometry element is reused multiple times before it is sent to one of the ShapeDiver Displaycomponents, it is possible to define only one instance of this object, and attach a special attribute to this object containing an array of transformations. When doing so, transferring data to and from the ShapeDiver servers becomes much more efficient because a single instance of the object is transferred. When it is received by the ShapeDiver viewer, the viewer parses the transform attribute and is in charge of displaying the various instances corresponding to the transfomations stored in the object.
Consider the following definition:
The same sphere is translated and copied multiple times. All 10 instances of the mesh are sent to the glTF 2.0 Display component, which will store all of them in the solution that will be transferred through the servers.
This definition can be slightly modified: instead of transforming the sphere, use the transfomation (X) output of the Move component to attach the list of transformations using the Attach Transformations component:
In this case, a single mesh is sent to the display component, resulting in an output size around 10 times lighter than in the previous example.
In practice the Attach Transformations component stores the array of transformations in a specific attribute with the name
transform. For that reason, the
transform name is reserved and should not be used for other purposes in case you are working with transformations.
Preview in the Rhino viewport
The ShapeDiver display components are able to preview all instances of the transformed geometry, even though only one instance is created in Grasshopper. Thanks to that preview, it is easy to check the final result that the ShapeDiver viewer will render.