bhom / speckle_toolkit Goto Github PK
View Code? Open in Web Editor NEWLicense: GNU Lesser General Public License v3.0
License: GNU Lesser General Public License v3.0
With latest version of Speckle, they have changed something with the Deserialisation (see also #53 (comment)).
This "trick":
Speckle_Toolkit/Speckle_Engine/Compute/SpeckleSerialisation.cs
Lines 60 to 68 in 7d72fe3
where I was setting the wrapper SpeckleObject Type
property to be the Name of the BHoMObject type no longer works, because now the Deserialisation from SpeckleAbstract is always attempted by SpeckleCore, somehow.
Type
override.BHoMObject type name to go in the private _type
field instead.
Consider multithreading for running the SpeckleSerialiser as a (temporary?) workaround to #49
Speckle_Serialiser is responsible for almost all computation time while performing the Push. We're talking several seconds per <10 Structure.Bar
s. I suspect it's due to a limitation of how speckle does its "serialisation" together with the deep nesting of our objects, which probably Speckle wasn't designed for.
SpeckleSerialiser does in fact expose a maximumNestLevel
parameter, which we cannot afford to use as we need to send eveything. (Edit: changing it does not seem to do anything).
Already highlighted the issue to Dimitri. I need to produce more detailed profiling; based on that potentially raise an issue in their Github.
In the meantime, perhaps #58 could help.
The BHoM issue templates have been updated, they need updating here.
The Pull Request template should also be housed within the .github
folder, as should any CodeOwner files (if applicable).
Create a Sphere in GH and Push it. The sphere is not visualised in the SpeckleViewer.
All BHoM files need to contain a BHoM copyright statement as their header.
For more information see Code Compliance - HasValidCopyright
Some breaking changes must have happened in Speckle -- the BHoM-Speckle_Toolkit scripts are not working anymore with few component missing. Replacing them with new ones makes the Push return an error "Could not deserialise the response body".
Investigate and apply needed changes.
Try any script in the Speckle_Toolkit script folder.
Scripts should work.
Needed to see whether tags can be successfully implemented together with the Replace/DistinctProperties/etc methods
As per BHoM/BHoM#499
Currently the adapter completely overrides the Pull. Ideally we should implement the Read.
Problem is, the Read only can return IBHoMObjects while we need it to be able to return also IObjects and object
in general.
As title
Updating toolkit to align with refactoring of the parent BHoMAdapter.
AssemblyFileVersion is at 2.4.0.0 and should be 3.0.0.0 for the beta development cycle.
We should also check the AssemblyVersion value, which should be 3.0.0.0
AssemblyCopyright should also read [assembly: AssemblyCopyright("Copyright © https://github.com/BHoM")] and not have a year in it.
Most "visualiser platforms" like Rhino, Speckle and 3DRepo use meshes to visualise objects.
For example, when you want to visualise a BH.oM.Structure.Elements.Bar
in the Rhino space, the following steps are actually done:
Another example can be done for Node
(see below), but we can imagine many other cases.
This means that for a variety of BHoMObject types we could compute a Mesh Representation, useful for visualisation purposes.
The whole process of generating a visualisable mesh should be definable and customisable per individual BHoM Types.
If there is agreement on this, we need to formalise how and where this should happen.
When you push a BH.oM.Structure.Elements.Node
:
You may want to visualise the node in several ways, depending on its properties:
For a pinned node we want a Mesh
containing a sphere on top of a cone.
For a fixed node we want a Mesh
containing a box.
Basically it returns a different mesh to represent different constraints based on the Constraint6DOF
. Reason to return a Rhino Mesh is because it's the only way we currently have to build "composite" meshes, AFAIK.
The mesh is converted into a Speckle Object, that acts as a bucket.
All BHoMObject data is stored into the Speckle Object.
I've now isolated 1 into MeshRepresentation
methods. It could be the case that those are moved up in BHoM_Engine, so they can be used also for other cases where we want to get a Mesh representation of a BHoMObject.
Getting a build error in Speckle_Adapter/CreateIBHoMObjects.cs
due to an ambiguous reference between BH.Engine.Speckle.Compute
and BH.Engine.Rhinoceros.Compute
This is a 2 sec simple fix -- will do now.
Build the project in Visual Studio.
The AssemblyFileVersion
attribute should now be updated to read 3.2.0.0
for all AssemblyInfo.cs
files within this repository for the start of the 3.2 milestone
Currently Speckle already has an Endpoint to get the diff of two streams.
The current response is similar in format to the AEC deltas specification, but it will need to match it exactly.
As a first step, implement a Read that receives the current JSON diff format.
This will be simplified when the fork of SpeckleServer by @PaulPoinet will then implement the right Delta format.
As feature requires a way for the user to specify the Stream Revisions to diff, this should be tackled together with #9
Currently we always push everything to one layer called "Default Layer".
Ideas:
Think how we could implement history (versioning) in Pull.
Push now can be configured to save Children Streams -- also called Clones in the Speckle viewer -- that can effectively be used as versions of the same model.
In the Pull we could implement a Query to get a specific version out.
Delete()
CRUD method of the Speckle_Toolkit adapter.@PaulPoinet could you have a look at point 1 and 2?
This includes:
Tell speckle "how to diff" based on the specified objects' Hashcode.
For some (quite convoluted/do not ask) reason, we would like to calculate the Hash for the BHoMObject externally to the object, not overriding/calling bhomObject.GetHashCode()
, in order to pass it to Speckle's Serialise
method (see question below).
With reference to the Serialise
method of Speckle:
https://github.com/speckleworks/SpeckleCore/blob/9545e96f04d85f46203a99c21c76eeea0ea03dae/SpeckleCore/Conversion/ConverterSerialisation.cs#L39-L53
is it possible to pass a custom HashCode, perhaps in the Dictionary<int, string> traverse
parameter? If so, how am I supposed to populate the string
part of the dictionary (which apparently represents some sort of "path")?
We are currently referencing a copy of SpeckleCore.dll included in the repo
Switch to nuget package
E.g. Bars are always extruded and represented with Meshes now. This is heavy and might impact larger models. Add option to toggle.
Important to allow speed on larger models.
Due to the bug #49 this issue can be considered as a critical workaround ATM.
IElement
interfaces are migrating to Dimensional_oM
This will cause every project which uses any of the IElement
s or any class inheriting from IElement
to need a reference to Dimensional_oM
.
Further more, any file using any of the IElement
interfaces explicitly, will need to add
using BH.oM.Dimensional;
Dimensional_oM698-Migrate-IElementXD-Interfaces-from-Geometry_oM
IElement
interfaces, add using BH.oM.Dimensional;
All referenced SpeckleCore
assemblies "Copy Local" must be set to False, otherwise you might get conflicting version and loading errors, in case you have another version of Speckle Installed (different from the one we target in Speckle_Toolkit).
SpeckleCoreGeometry
instead needs Copy Local to true in order for the Toolkit to work.
There should be no direct reference to local dlls anymore and only reference through NuGet. This is necessary to enable CI through AppVeyor.
Messages from Speckle need to be returned to the UI.
Those may be "appended" to the component balloon via the Engine.Reflection.Compute.RecordError
mechanism.
However that could be problematic -- consider scenario where a message is given for every object pushed. See if speckle has different logging levels.
Another option for returning the would be to somehow add some "info" output from the Push.
In order to do #59,
the Speckle library called SpeckleCoreGeometryRhino
has to be referenced by the Speckle_Toolkit.
A Nuget package is still not available for that library, however it's on the roadmap to be produced.
Therefore, we decided to temporarily copy the library in this newly created _tempRefs
folder in the repo.
This will have to be removed once the Nuget is available.
Unlike Meshes, Lines and Points, for which we already are the converts, other types (like Breps) are not so simple to convert.
It would be an easy job if we could reference SpeckleCoreGeometryRhino, because that project contains all the converts from Rhino classes to Speckle classes.
However, the only nuget package for SpeckleCoreGeometry seems only to include the SpeckleCoreGeometryClasses, which are the base geometry types (SpeckleLine, SpecklePoint etc).
We could solve this by
If we clarify the strategy for this one, we might as well just pass through rhino for all our geometry types, then use the speckle converter for them.
This could be quite advantageous for us, because we could maintain less convert methods (the BHGeom to Rhino and vice-versa are needed anyway).
Updating toolkit to align with refactoring of the parent BHoMAdapter.
To be done by 24th January 2020
Update toolkit assembly file versions to the new milestone - file assembly version should now be 3.1.0.0
To be done by 10th January 2020
First time you push objects to a new Stream, they don't get added.
You need to push a second time in order for them to be actually Pushed by the speckle client.
Might this be due to the fact that we use the method StreamUpdateAsync
every time we push?
Needs investigation.
Create a new stream with speckle using the Data Sender component. Attach the ID to the SpeckleAdapter component. Push some objects.
Objects will not appear at the first push.
If you push again, they will appear.
From there onwards the Push behaviour will always be correct (stream will be updated every time you push without having to do it twice).
Object should appear at the first push also for newly created streams.
After ploughing on with the development I realised the Push is unnecessarily complex.
AssemblyFileVersion is now at 2.1.0.0 for most assemblies.
The plan is to update the AssemblyFileVersion property of the assembly to 2.3.0.0 and leave the AssemblyVersion as it currently is.
In line with the discussion on BHoM/BHoM#733 and subsequent changes to BHoM in BHoM/BHoM#734 it is desirable for all objects to now contain the virtual
modifier to provide greater flexibility for developers and users wishing to create BHoM objects in their workflows.
This issue is to instruct @BHoMBot to carry out the task of adding the virtual
modifier to any object in the oM of this repository where it does not already exist.
Speckle exposes some kind of history in the viewer. Check how we could use that.
Edit:
The SpeckleStream
can have children
streams -- also called Clones in the Speckle viewer -- that can effectively be used as versions of the same model.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.