Sorting intersecting objects

Hi! I’m trying to sort two intersecting types of objects which are listed undependable from each other.

I’m have solids on one hand and surfaces on the other, and I want the surfaces sorted in the same order as the solids.

For example, in the picture you can see the intersect node identifies that surface 0 and 1 is intersecting Solid 1:0.

I just don’t know how to go from here to get a list with the surfaces in the same order as the intersecting solids.


@Sampa88 ,

be sure that the surface and solids have a relationship!

can you share the whole graph?

Hi @Draxl_Andreas and thanks for your answer!

Every Surface has a corresponding Solid which it intersects with if that’s what you mean with relationship?

I don’t think the rest of the graph means anything for the problem really, it’s some excel data fetching.

Attached picture shows how my desired end result list would look like.

Where L2 in the lists represents the solids and then the Surfaces which intersects with them.

I’m just struggling to figure out how to get Dynamo to do that list from my inputs :smiley:

What I was originally looking for was a way to select geometry within a bounding box, but after no luck searching the forums I started with this workaround instead :stuck_out_tongue:

1 Like

@Sampa88 ,

for that result you need a boolmask

Amigo @Sampa88, What you are looking for is the surface resulting from comparing the intersection of a solid vs a surface? Modification nodes in Geometry - Solids - Solid are very useful to work with geometry, the one I like the most is Geomtry.Intersect, I hope this helps you to achieve your goal, note to see the results, you have to deactivate the preview of your original geometries. (Back ground script autor: Jacob Small in dynamo Office Hours you tube).

If you want the intersections to match the solid order instead of the surface order then you should set the solid input (other) to @L1 instead of the surface input (geometry). That will cause the DoesIntersect node to loop through each solid input in its entirety, aka with each surface, before moving on to the next solid.

maybe this?

Oh yeah, that did it! I managed another workaround which was not very sophisticated with groupbykey node, but this is more straight forward. Thanks!