Speckle Viewer Breps/Surfaces

Hi all :wave:,

I’m using the GH connector to send some stuff to Speckle; when sending Breps I get an ugly version of the geometry being shown in the viewer, however if I explode these in Breps in GH and send the resulting surfaces I get nice clean geometry. This matches what I get when I send the geometry via Rhino. Is this a bug, or is it just how Breps in GH get translated?


^ Breps


^Surfaces

Any help with this would be fantastic~

1 Like

I feel like this is related to ambient occlusion we’ve recently implemented. Just to be sure, can you share the stream or Rhino/Grasshopper file you used?

Here’s the stream @gokermu; it has two commits from GH - one sending Breps and one as exploded breps (as a collection of surfaces).

https://speckle.xyz/streams/857d7e1de7

Thanks for taking a look at it! Keen to know if there’s a fix :slight_smile:

@lukxfnz we’re thinking this might be a problem with the normals of the geometry, are you able to check?
Otherwise if you share the model we can have a look as well :slight_smile:

1 Like

It would be my guess as well!

Hi @gokermu ,
Does the viewer allow to visualize mesh transparencies?

Hey @tomasmena

as far as I’m aware:

  • Meshes with a transparent material attached: yes
  • Meshes with transparent vertex colors: no

Thank you @AlanRynne !!

Hi @AlanRynne , does the viewer allows reflectivity on objects when sending them from grasshopper?

Hi @tomasmena

The viewer has the capability of rendering materials with the following properties:

  • Diffuse (aka base color)
  • Opacity
  • Metalness (aka reflectivity)
  • Roughness
  • Emissivity (EDIT: looks like the viewer doesn’t render this one, but other apps can)

However, the question is, does our GH connector send all these material properties?

GH is not my area, but from the quick test I’ve just performed, it doesn’t look like we send any render material data; No color, transparency, or anything. :cry:

I’m not sure if this is a bug, or if GH simply doesn’t have access to Rhino’s Render Materials. Hopefully @AlanRynne knows more.


I do however know that from our Rhino connector, we output all these properties, at least for Rhino 7.
For Rhino 6, just diffuse color, emissivity, and opacity (faked for a few presets)

2 Likes

@Jedd Thanks a lot for your answer… I noticed that the objects exported from rhino can store the textureCoordinates that allow some sort of reflectivity on the viewer. Can we send this as extended properties of an object from grasshopper?

1 Like

So, to fill in on @Jedd’s answer:

Grasshopper doesn’t send any material data because grasshopper-generated geometry does not have any of that data by default.

On the Rhino SDK, material’s are not attached to the Geometry object but rather to the RhinoObject they are wrapped in. Since Grasshopper does not use these RhinoObject instances (rather the raw Rhino.Geometry classes) the only solution here would be to create Speckle Materials in grasshopper and attach those to the already converted Speckle Meshes in their renderMaterial property. This can be done by using our extend node, or with in a simple Python script for more flexibility without the need of referencing our libraries.

As for the texture coordinates, those are in fact attached to the Meshes themselves, but grasshopper does not compute texture coordinates, and as far as I’m aware any grasshopper-generated mesh will have no texture coordinates by default. There are ways to generate them on the Rhino SDK (and some Grasshopper nodes afaik) but this falls out of my area of expertise.

You could also attach a list of texture coordinates by extending the objects, but I’d recommend setting them in Rhino before converting to Speckle.

Final thought:

As I was writing this I realised there is one edge case where we could be sending materials: referenced geometry from a rhino document. In this case, I’m fairly certain we could attach the material automatically from Grasshopper, but that will only work if you don’t further process it in Grasshopper (as it will loose the reference)

Hi, just wondering if the reason for this was identified?

I’m having the same problem.

https://speckle.xyz/streams/542c3f3dcb/commits/7637f937d1?c=%5B23.83423,21.70284,12.08507,9.925,6.925,3.5,0,1%5D

Hey @MatthewF

Welcome to our forum! Our assumption is that it might still have to do with the model normals, and not with the viewer.

Are you able to display the normals of the model or to send us a sample from the original authoring tool?

Hi @teocomi, Thanks.

Here is a screenshot in Grasshopper:

In the viewer:


https://speckle.xyz/streams/542c3f3dcb/commits/90afd077ea?c=%5B2.08211,-5.4188,5.48052,0.00946,0.69605,1,0,1%5D

And the grasshopper script.
221201_wallTest.gh (10.7 KB)

Thanks! This one looks alright, no?

Hi all!

I poked around our Brep conversion logic and found the reason why this was happening.

I have a fix ready and it will most likely be released tomorrow on our 2.10.2 version.

Current

After the fix

Thanks all for the feedback on this! :raised_hands:t3:

6 Likes

Thank you very much for your answer.