Group Brep into Sub Branches based on Value

I have a series of breps of various sizes. I have grouped all the same breps into branches.

I need to split the branches into further branches based on the location of a curve in relation to each brep.

I am running into an issue of further grouping based on the curve location. I keep getting the correct list length and sub branches but the geomtry seems to be duplicated in some locations.

Group by brep type


Group Brep Type by curve location



Group Channel.gh (29.1 KB)
Group Channels.3dm (4.2 MB)

Would it be something like this?
Note that I’m using create tree from Elefront.


Group Channel.gh (19.8 KB)