Error: Shading Mask is flipped in Rhino 7

Hi all,

When I was running the Shading Mask component in newly installed Rhino 7, the dome shown was flipped underground as the picture. However this file works well in my Rhino 6. Not sure what the reason is. Does anyone have some ideas on that?

Thank you!
Tina

04-Shading Mask.gh (428.4 KB)

Hi @tiffiena. Even i am facing the same problem. The shading mask is flipped underground in Rhino 7. One more error is that when projection is set to stereographic it throws error.
@Chris Can you please help us out?

Thanks for letting us know, @tiffiena .

Given that it would take me as much time to write a version of this component for the soon-to-come LBT 1.2 plugin than it would to fix this issue here, I think I will prioritize writing the new version. Such a new version will work in both Rhino 6 and Rhino 7 and it will have all of the other benefits of the LBT visualization components (eg. better text objects, faster runtime, etc.)

Can you workaround this Legacy issue in Rhino 7 by just mirroring the output until LBT 1.2 is released?

1 Like

@chris Thanks for the info. Mirrioring is helpful for now but switching to the stereographic projection is throwing error. Not able to use the component.

Hi @chris. With the latest updated version of Rhino 7 the shading mask component crashes rhino once it is dragged and dropped in to the canvas

Thank you for letting us know, @Asisnath . Since it’s causing Rhino to completely close, then we should let @wim or someone from the McNeel team know. This usually indicates an uncaught exception of some kind deep in Rhino 7 that McNeel will want to fix. I was able to recreate it on my end and I have uploaded the Rhino crash dump below:

https://drive.google.com/file/d/1u7Si20JfWIjo0lti966WrxxqSbnc1iLz/view?usp=sharing

Once this issue gets fixed on the McNeel end, I’ll try to set aside some time to see if I can fix the upside-down issue.

1 Like

Thanks for hailing and the crash dump file, Chris.
I was able to reproduce this here and found the first internal build that broke this.
I put it on the list for the developers to take a look - RH-62317.
-wim

1 Like

Thanks, @wim , for the quick response. I’ll keep an eye on the issue.

@chris @wim I investigated the cause of this error and pretty sure found where the problem is. The new mesh intersection API is failing to compute .MeshRay intersection on an empty mesh (Context_ input is empty)

You should be able to disable GH engine, drop a Shading Mask component, open the editor, and change line 287 to:

if joinedContext.IsValid and rc.Geometry.Intersect.Intersection.MeshRay(joinedContext, ray) >= 0.0:

This should resolve the error although I have not tested it in a real LadyBug project. It’d be awesome if you can. Meanwhile we work on updating the API to “not crash” :smiley:

2 Likes

Thanks, @eirannejad. I applied the changes you suggested to the code and it worked. Now Rhino is not crashing. But still getting the inverted shading mask dome. Hope @chris shares some update on this
soon.

2 Likes

Thanks @eirannejad and @Asisnath ,

I just pushed @eirannejad 's recommended fix to our github and I also found the place where the shading mask was being turned upside down. So it will now be right-side up in Rhino 7 after you run the “Update Ladybug” component:

It seems that it didn’t actually take that big of a change to implement the upside-down fix but the Legacy code is such a mess that it took a while to find the problem. I appreciate you taking the time to look through such messy code @eirannejad . Things are going to be much cleaner in the LBT version of this component.

3 Likes

Thanks @chris. It was quick from your side.

Hahah no worries. I love playing with pythons :snake: Thanks for getting this updated so quickly. we also got the bug fixed on our end and it should be good for R7.4

1 Like

That’s why I love this forum.
I saw another post that mentioned an issue with shading mask on Rhino 7, went to fix it, found a problem in the “rc.Geometry.Intersect.Intersection.MeshRay”, googled it to see if it is a Rhino 7 generic issue and was prompted to this page where @eirannejad had already fixed it. :slight_smile:

@chris , sorry for the messy code :frowning:

2 Likes