Ignore the geometry inside

Hi. Is there a way to create a material for the rhino renderer to ignore the geometry inside the object, so that if half of the diamond is in the metal, the metal is not displayed in the interior of the diamond. ?

I thought about creating material in C#, but I don’t know if it is possible in Rhino . I don’t know which way is better: create a metal that doesn’t render inside other objects or create a stone that ignores the object inside itself. Anyway, I don’t understand how to make these settings.

With Rhino 7 render engine and Raytraced it is not possible to do this not even with custom coded materials.

Your best bet is to actually apply a boolean difference to the object with the metal material applied.

What if use Cycles?

Raytraced and Rhino Render in Rhino 7 use Cycles.

I don’t know what other engines support, or how easy it would be to set up in Blender Cycles, if possible at all.

Theoretically, you can define on a geometry that has a metallic texture, a geometry that has a glass texture, and apply transparency to the intersections up to the metallic texture.

PrincipledBsdfNode+TransparentBsdfNode +LightPathNode+MixClosureNode

Yes, but there are no provisions for that in the Cycles integration in Rhino.