In my current project, I need to analyze the relationships between contour lines and diagram them into a Tree structure. I found that this process is called a ‘Contour Tree’ and there are many papers on this algorithm. However, the process is complex, and I wanted to solve it myself in Grasshopper, but I encountered a few difficulties.
1. The concept of a Contour Tree involves each peak becoming a branch. I am not sure how to represent the branching in Grasshopper.
2. Even if I manage to create the proper connections, I am having trouble converting the relationships between the contour lines into a bubble diagram format.
This part of the project is crucial, so I would greatly appreciate any help. Any assistance you can provide would be deeply appreciated.
Maybe something basic to look into here is using point groups?
Not sure it aligns with the ‘contour tree’ concept with full fidelity, though - or if you strictly need said concept for your diagramming purposes. Anyway, looking at this quickly, if the goal is to draw relationships between terrain contours, there are a few topics you could search the forum for such as slope analysis, grouping contours based on ‘elevation value domains’, or using 3D proximity to also obtain topology data, similar to what the topologizer tool suggested by Martin might facilitate.
You could use the contours’ bounding rectangles, grab the center points, and make point groups based on a distance you indicate and start figuring out relationships that way.