When the same geometry element is reused multiple times before it is sent to one of the ShapeDiver Display components, 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.
Attached transformations will only be displayed in the Rhino viewport and in the online viewer when used along with the glTF 2.0 Display component.
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.
Using Transform Lists
In practice, when using the “Attach Transformations” component, the ShapeDiver plugin converts the list of transformations into a single “Tranform List” object that is ready to be stored as an attribute. When extracting again the attribute from the geometry using the Extract Attributes and Deconstruct Attributes components, the resulting extracted attribute will be a “Transform List” as described above:
Because of this technical detail, the ShapeDiver plugin also includes components to convert Transform Lists to and from lists of Transformations in Grasshopper. The first use case is to use the Explode Transform List component in order to access a list of transformations extracted from geometry as in the example above.
Additionally, using the Create Transform List component can make it more convenient to add a transform attribute to an existing attributes object, which is not possible only with the Attach Transformations component: