I am struggling to display a Structural2DElementMesh in Grasshopper from the following stream: https://hestia.speckle.works/#/streams/AYRTIaueG
The results are shown correctly in the online viewer (see screenshot).
Regarding the other values that you struggle to display, this happens because the result output is a list of Rhino Dictionaries (which as youâve noticed are actually empty).
I think I could help you to figure out whatâs wrong if you share the part of the definition that is situated before sending the meshes (i.e. how you attached values to your meshes) - you can simply internalize the necessary values instead of sharing the whole script that generated those values.
Hello @tlmn! I think you can simplify a bit your code.
var speckleMesh = new SpeckleMesh { Vertices = vertices, Faces = faces };
speckleMesh.properties = new Dictionary<string,object>(); // to make sure it's initialised
var myResultDict = new Dictionary<string,double>();
myResultDict["epsilon_x"] = etc;
myResultDict["epsilon_y"] = etc;
myResultDict["epsilon_z"] = etc;
//...
speckleMesh.properties["8001"] = myResultDict; // "8001" is a weird key name, but i assume it's something you need
PS: creating a mesh from each quad is very inefficient⌠but letâs leave that for now
Hey @dimitrie,
8001 is one of my load cases, so i thought a good key for my result dictionaryâŚ
Setting my results as custom properties works now also with Grasshopper! Thanks!
What´s the reason to use Structural2DElementResult then?
P.S. I wanted results per quad (not per node), which meant, I had to create a mesh for each quad. I already noticed that it´s âquietâ inefficient⌠Any other suggestions?
@mishaelnuh might be able to shed more light on Structural2DElementResult, iâm at a loss. Itâs used to get stuff out of GSA, afaik, so it might be tailored for that. There were some compromises involved
@mishaelnuh also elegantly dealt with extracting results both per face and per vertex (needed to colour things in the browser).
@mishaelnuh also is now back to school doing cooler things, unfortunately
Off the top of my head, i would do this, to keep things in one mesh:
add each quadâs vertexes in one meshâs vertex array, duplicating the common ones
add the faces array based on the above
add results_x_per_face prop, with your results per quad, as youâre doing now â nice results in gh
add, as well, results_x_per_vertex, which would just be the value from above times x, where x is 3 or 4 (triangle/quad) â shows nicely in the online viewer
Even though thereâs duplicate info, just keeping things inside arrays like this would make life much snappierâŚ
As @dimitrie said, Iâm busy with uni (although if Iâm doing cooler things is debatable), but I think I can point out some tips which may point you in the right direction!
Firstly, Dictionaries and Lists sometimes do not get deserialized properly in GH using the components. A way to resolve this is to skip the conversion step so as to keep the object in its original form. You can do this by right clicking the Receiver component and making sure âDeserialise objectsâ is not checked.
Secondly, accessing the dictionaries requires some finagling unfortunately. Never managed to have time to implement this before I went back to school (maybe some time in the distant future as a procrastination technique).
Iâve included a GH definition which demos contouring a mesh with results from GSA. Youâll definitely have to change it for your results, but hopefully itâll shed some light into the problem! The stream is stored on the Hestia server and should be public.