Speckle.OCC almost working but fail to deserialize in Rhino

Hello all,
The Speckle.OCC is almost working!
I can send this .brep file from python-occ to Speckle and then receive it back!


Also when sending a line or curve the viewer displays it correctly

But… Rhino or Grasshopper fails to deserialize. The error ends saying a value cannot be null, but doesn’t say which one. Or maybe it is “item”, but I don’t see a value called item in the data model.

So my question is :
In the following error, could you point out which value should not be null in Rhino?
Speckle link for the brep sent from python-occ : https://app.speckle.systems/projects/864c4d4027/models/9c0ec10379@4fbe4bd5a4
Speckle link for a curve sent from python-occ : https://app.speckle.systems/projects/864c4d4027/models/9c0ec10379@8318ec0fa3
Speckle link for a line sent from python-occ : https://app.speckle.systems/projects/864c4d4027/models/9c0ec10379@521f387c44
Thanks!
Error in Grasshopper (sorry some french stuff because of my computer) :

  1. Une ou plusieurs erreurs se sont produites.
    Failed to deserialize {
      "id": "066f7f70e2565c7350d5cff4f44ef247",
      "name": null,
      "units": null,
      "elements": [
        {
          "referencedId": "ec7f7f911e5252ea1a56cf9f0baf08f3",
          "speckle_type": "reference"
        }
      ],
      "__closure": {
        "0b1d418ea1cb47fd3c8fca26e6771688": 2,
        "142d216fb4142a85254e197c0131c134": 2,
        "311824b9279008c4681183654af06097": 2,
        "336280a348e397ac588e6f9d6fe609b8": 2,
        "3a2e878dfec3dcd899d5a77fe5d4f935": 2,
        "9cca9fad796b988e9e3bf192a27a831d": 2,
        "a850c940663b84dbf631e459635f4e13": 2,
        "e3951fce7f95bbd593be62f902f6512f": 2,
        "ec7f7f911e5252ea1a56cf9f0baf08f3": 1
      },
      "speckle_type": "Speckle.Core.Models.Collection",
      "applicationId": null,
      "collectionType": null,
      "totalChildrenCount": null
    } as Object
        Failed to deserialize reference object
        Une ou plusieurs erreurs se sont produites.
        Failed to deserialize {
      "id": "ec7f7f911e5252ea1a56cf9f0baf08f3",
      "area": null,
      "bbox": null,
      "units": null,
      "volume": null,
      "IsClosed": true,
      "__closure": {
        "0b1d418ea1cb47fd3c8fca26e6771688": 1,
        "142d216fb4142a85254e197c0131c134": 1,
        "311824b9279008c4681183654af06097": 1,
        "336280a348e397ac588e6f9d6fe609b8": 1,
        "3a2e878dfec3dcd899d5a77fe5d4f935": 1,
        "9cca9fad796b988e9e3bf192a27a831d": 1,
        "a850c940663b84dbf631e459635f4e13": 1,
        "e3951fce7f95bbd593be62f902f6512f": 1
      },
      "EdgesValue": [
        {
          "referencedId": "0b1d418ea1cb47fd3c8fca26e6771688",
          "speckle_type": "reference"
        }
      ],
      "FacesValue": [
        {
          "referencedId": "311824b9279008c4681183654af06097",
          "speckle_type": "reference"
        }
      ],
      "LoopsValue": [
        {
          "referencedId": "e3951fce7f95bbd593be62f902f6512f",
          "speckle_type": "reference"
        }
      ],
      "TrimsValue": [
        {
          "referencedId": "336280a348e397ac588e6f9d6fe609b8",
          "speckle_type": "reference"
        }
      ],
      "provenance": null,
      "Orientation": 1,
      "displayValue": null,
      "speckle_type": "Objects.Geometry.Brep",
      "Curve2DValues": [
        {
          "referencedId": "9cca9fad796b988e9e3bf192a27a831d",
          "speckle_type": "reference"
        }
      ],
      "Curve3DValues": [
        {
          "referencedId": "a850c940663b84dbf631e459635f4e13",
          "speckle_type": "reference"
        }
      ],
      "SurfacesValue": [
        {
          "referencedId": "3a2e878dfec3dcd899d5a77fe5d4f935",
          "speckle_type": "reference"
        }
      ],
      "VerticesValue": [
        {
          "referencedId": "142d216fb4142a85254e197c0131c134",
          "speckle_type": "reference"
        }
      ],
      "applicationId": null,
      "totalChildrenCount": 8
    } as Object
        La valeur ne peut pas être null.
    Nom du paramètre : item
    
1 Like

Hi @RaphaelVouilloz,

We need to understand which version of Rhino/Grasshopper connector you are trying to receive that model? I looked at the brep and there is many null values, hard to say without knowing the version you are working with.

PS: What you are cooking is :heart:
PS2: Did you check the next-gen connectors? Because we are not maintaining v2 connectors unless a critical bug. It would be nice if you can start looking at it because we have been changing our object model a bit.

1 Like

Hi @oguzhan
Thanks! :smiley_spockle:
Indeed I was using V2 connectors, but I’ve just tried with Rhino next-gen connector and have the same problem.
One precision : receiving line or curve in Rhino from python-occ works, so the bug is really at the level of the brep
From which the following values are null : area, bbox, units, volume, provenance, displayValue, applicationId

Also @ahmedwael94 just tried to debug inside Rhino, we’ve found the error but cannot identify which null value it is related with. Ahmed suggests a zoom this afternoon if you are free?

Btw, the code if it may help :
send from python-occ : speckle-freecad/occ-send.py at 2f46be0e0737b283c2af0b8473cbe480fd7d58b5 · ENAC-CNPA/speckle-freecad · GitHub
receive in python-occ : speckle-freecad/occ-receive.py at 2f46be0e0737b283c2af0b8473cbe480fd7d58b5 · ENAC-CNPA/speckle-freecad · GitHub

Hiya! In Next-Gen rhino, this would also fail as in V2, if you are sending breps and not the new opennurbs encoded brepx objects (we’re using this encoding for breps, extrusions, and subd)

If you want to check out the new encoding:

For your error, first take a look at the brep class here:

and check that any required property is present in the brep you’re sending (eg, units shouldn’t be null)

3 Likes

Thanks a lot @clrkng , indeed I am using this library :

Indeed I will have to update in the future.

For now I have tried to inform all null values, but I still have the problem. :smiling_with_tear_spockle:

Something I don’t get is : bbox for example seems to me a “non-mandatory” metadata to be able to rebuild the brep. Can Rhino reception bugs if such “non-mandatory” data is not informed? Where could I get a list of which metadata is mandatory and which is not?
Thanks

With @ahmedwael94 we had another idea of where the bug could come from :
which is the conversion from python to C#?

Because If I send from python-occ to speckle, then receive in python-occ from this url, it works.
But the reception doesn’t’ work in any other connectors (tested in Rhino, gh, Revit and Archicad)

Is there a connector built with python that I could test with (using Brep, so apart from Blender)?

Thanks :smiley_spockle:

Hi @clrkng
Would you be able for a zoom with @ahmedwael94 and me please, to take a look at the debug in Rhino?
Or anyone in the Speckle team?
Thanks!

1 Like

Yes, will ping you my calendar - I’ll pull in a speckle py dev as well, since it’s looking like an sdk incompatibility issue

Thanks a lot @clrkng !
We’ve booked on Thursday at 4pm Switzerland = 3pm in London.

Hi, @RaphaelVouilloz

With the brep model https://app.speckle.systems/projects/864c4d4027/models/9c0ec10379@4fbe4bd5a4

It looks like like its failing on this TrimsValue property because you have sent null values in a list that expects only integers (long)


You can also see this from the viewer is you enable the dev mode

3 Likes

Hi @Jedd
Eurêka :partying_spockle: :starstruck_spockle:
Indeed I was not sending IsoStatus inside BrepTrim
I’m so happy, thanks. I was not used to dev mode in the web viewer, it is really useful.
@clrkng let me know if you still want to take a look at the project tomorrow. We are currently planning a visit to London in June with @jonathon, so we will present our work there in any case

1 Like