Problem in creating a gradient contour in a gap between a Brep and a Mesh

Hello everyone,

I’m currently working on a project in Grasshopper where I’m attempting to create a gradient contour in the space between a lower Brep and a mesh positioned above it. My goal is to then adjust the color of this contour’s surface based on its distance from the base Brep.

To achieve this, I’ve taken the following approach:

  1. Creating points on the base brep.
  2. Projecting these points onto the mesh surface.
  3. Generating a surface from the projected points using the “Surface from Points” component.

However, I’ve encountered an issue where the process is producing null points in the projected points, resulting in an error. I’m struggling to identify the root cause of this problem.

I’m reaching out to the community to seek advice and assistance. Does anyone have insights into what might be causing the null points in the projected points, or perhaps an alternative method to achieve the desired gradient contour effect?

I’ve attached the Grasshopper file for reference. Any help or guidance would be greatly appreciated.

Thank you in advance for your assistance.

Gradient (10.7 KB)