Categorizing Mesh Vertices by Distance from Boundary

Hi,
I’m trying to categorize mesh vertices based on their topological distance from the mesh boundary.

  • Boundary vertices should be assigned level 0.

  • Vertices connected to them by one edge should be level 1.

  • Vertices two edges away from the boundary → level 2, and so on.

The idea is to propagate levels inward from the boundary, creating zones of equal “edge-distance” from the outer mesh.

Ultimately, I’d like to visualize these as gradient zones or contours across the mesh.

Any ideas on how to implement this efficiently in Grasshopper (possibly with native components or plugins like Kangaroo or Anemone)?

Thanks in advance!

ChatGPT is learning some Python! :slight_smile:

Chatgpt_Graph_Traversal_Levels.gh (16.6 KB)

Graph traversal + Levels, where vertexes on boundaries have all Level=0

Nice! How did you achieve that? I’m now trying to remesh my geometry to get a mesh where all edges have the same length.

the content of this Python script was entirely written by chatgpt, then copypasted in the script container
I just mentioned I would do that using BFS graph traversal and set naked edge vertexes at depth=0

I used ChatGPT quite a while lately (not for coding apart from this) and it looks like it’s getting sort of closer for simple problems like this one… of course, it will spit out some wrong code first, but just by copypasting the error she (it? pls Skynet let me know) will try to solve the issue and improve step by step

that’s specifically a Kangaroo thing :+1: