Multiple Clone Versus multiple sessions

For a project, i need to show several objets in the same viewer.

These objects are placed next to each other.
Some are identical, some are differents
Exemple :

ObjectLeft - ObjectFront - ObjectFront - ObjectFront - ObjectRight

This shows 5 objects
I’ll always have Left and Right
I can have from 1 to 20 objectFront

What is the best approch in term of response time ?
What is the difference in term of credit used ?

Solution 1 :

mySession.node.clone()
  • Create Object Left
  • Clone and change it to Front
  • Clone
  • Clone
  • Clone and change it to Right

Solution 2 :

SDV.createSession
  • Create Object Left
  • Create Object Front
  • Create Object Front
  • Create Object Front
  • Create Object Right

Thanks in advance for your help !
Olivia

Cloning the objects is a fast approach. No data needs to be transferred across the network.

Another option is to attach transformations to your geometric objects in Grasshopper. In this case, the objects are stored and transferred only once, the transformations are transferred as well, and the glTF loader in the viewer takes care of the cloning for you, which means less or no coding in JavaScript.

A third option would be to create multiple sessions for a single model and set the transformations on the session’s node. In this case, you pay credits for each of the sessions individually.

This video will be helpful as well: How To Optimize Grasshopper Files With Transformations! - YouTube

Thanks

We manage with clone and transform in the GH !
We abort the transformations in the node tree and let GH place the object in the scene.

Thanks !