In your Grasshopper definition, there are several ways to display geometry and output information to the ShapeDiver online viewer. For technical and security reasons, the number of these outputs is limited in several ways, which we describe below.
Limitations regarding geometry outputs
Definition of file parts
These limitations concern all types of geometry which can be displayed in the ShapeDiver viewer. We call "file part" each piece of individual geometry that makes it to the viewer. This name comes from the fact that each individual object is stored in a separate small file which is downloaded by the viewer and loaded in the scene. This geometry can come from your Grasshopper definition through any component with the preview turned on, the Grasshopper Custom Preview component or the Legacy Display component. In the first two cases, each component will always produce one single file part, with all the geometry merged into a single mesh. For that reason, it is unlikely that using these components will ever break the limitations.
However, the Legacy Display component gives more control over the data structure that travels to the viewer, which is really useful for some API use cases and for applying advanced materials. More precisely, this component will create a separate file part for each branch of a tree connected to it.
Using the glTF 2.0 Display component, the tree structure is not preserved and all pieces of geometry are merged into a single file. For these reasons, one glTF 2.0 Display component produces only one file part, which means the limitations are unlikely to be reached when using this component.
Number of file parts per output
ShapeDiver only allows 64 file parts per Legacy Display component. Always check if you really need to keep your objects separate in a tree. Otherwise, think about flattening your data structure to reduce the number of file parts in the model.
Total number of file parts
Additionally, there is a limit on the total number of file parts in the definition, for all output components combined. ShapeDiver only allows a total of 256 file parts per definition.
Number of transformations per output
In order to make the model faster and lighter, ShapeDiver lets users attach transformations to a single piece of geometry before sending it to a ShapeDiverDisplayGeometry output. That way, only one file part needs to be downloaded to the viewer, and its transformed instances are created directly in the scene.
Example definition with attached transformations
Download a definition explaining how to attach transformations to a piece of geometry.
Using transformations is a good way to load a lot of objects in a scene without hitting the limitation regarding file parts. However, there is also a limitation of transformations for each output: ShapeDiver only allows to attach up to 1024 transformations per output component.
Limitations regarding all outputs
Definition of data parts
Data parts are all the pieces of information and geometry that are loaded in the viewer. This includes the file parts described in the section above, but also some other data types:
2D and 3D Text tags (they are compatible with ShapeDiver). In this case, each tag represents one data part, regardless if it is a single element, a list or a tree. The example below shows how to create a list of tags, each representing one data part:
Data sent to a Direct Data Output component. This component will preserve the data structure (trees and lists) for ease of access with the API. However, one Direct Data Output component only counts for one data part as a whole. Feel free to use them extensively.
Total number of data parts
The total number of data parts allowed is 1024 per definition.
Number of data parts per output
Each output is limited to 256 data parts. In practice, this is mostly a limitation regarding text tags, since file parts are already limited to 64 per output.
Size of a data output
This limitation concerns the raw data size of single data outputs. Each data output is limited to 400kb. This includes the text sent in the body of emails from Email Export components.
Limitations regarding textures
For optimal performance, texture images used in a definition should be square and with a size a power of two (128x128px, 256x256px, etc...). If textures don't follow these requirements, they will be resized by our servers.
More importantly, the ShapeDiver viewer currently supports only textures files smaller than 4mb.