Speckle BHoM integration - aecdeltas/aec-deltas-spec GitHub Wiki
Please see: https://github.com/BHoM/Speckle_Toolkit/wiki
Export of BHoMObjects with Visualisation in SpeckleViewer
Improvements
How does it work
We want 3 things:
- The visualisation of the objects with some geometry in the SpeckleViewer
- the navigation of the serialised properties of the BHoMObjects within speckleViewer
- The deserialisation of BHoM data on the received end with all the information.
Current approach:
- Create a SpeckleMesh (or speckleLine, etc) with the geometry representation of the BHoMObject (e.g. for a Bar, the extrusion mesh)
- Use the SpeckleCore serialiser to serialise bhom data and append it to the SpeckleMesh
// Add the BHoMObject to the SpeckleObject Properties Dictionary via the Speckle Serialisation speckleObject.Properties.Add("BHoM", SpeckleCore.Converter.Serialise(bhomObject));
This poses a problem on the receiving end, because receiving the object and deserialising with
SpeckleCore.Converter.Serialise
creates:
Meshes/extrusions
We're exporting the geometry as meshes. Heavy.
- How does SpeckleExtrusion work?
public SpeckleExtrusion(SpeckleObject profile, double length, bool capped, string applicationId = null, Dictionary<string, object> properties = null);
how should the SpeckleObject
be created? As SpeckleCurve
? How can I define the extrusion direction?
How does it work
In order to allow the navigation of the properties in the BHoMObjects, we
SpeckleCore serialiser is slow with BHoMObjects.
This is for the portal frame example: 5 bars 2 nodes, where it took about 8 seconds to export:
This doesn't allow to append "speckleSerialised" BHoM data to the objects when we have many of them.
The following objects have bhom data serialised as JSON only and appended to the SpeckleObject.Properties
dictionary: