Iterate a list with itself

I am trying to create something similar to a Venn Diagram in dynamo. I need to find the area where the most circles intersect (This zone will be our working area).

This will be a tool that many people will use and therefore I can not be sure of the number of circles in each case. I came to the conclusion that the list needs to be looped against itself until there is no more surfaces left.

My method so far has been to create all of the circles (The radius and centre points are in an excel file) and then I am trying to use the Geometry.Intersect node to get the geometry of any intersections.

I have going through the forum and using the examples but I either did not do them right or they didnā€™t work in this scenario.

try this
set lacing on your last node to crossproduct
maybe you have to drop one item in one of your lists to prevent intersection checking on itself

1 Like

Hi edward
try the script below i hope it helps you ā€¦


Circle Intersects.dyn (27.3 KB)

Have a good day

2 Likes

Changing the Lacing worked! I have all the intersections, but it has also performed intersection checking on itself and therefore shows everything as intersecting.

I tried dropping an item to stop it but that didnā€™t work.

I have copied this exactly but cant get it to work. It returns a list of ā€œEmpty Listā€.

can you share the sample and the .dyn file

1 Like

Here it is !

changed a little please do let me knowSampleDynChangedlittle.dyn (248.7 KB)

2 Likes

I ran it and it only showed one circle. I need it to show all of the parts of every circle that overlap.

if u require the intersection of all the circles you must run it again till you attain one single intersection area ā€¦

1 Like

When I ran the SampleDynChangedLittle it showed a full circle (including the zone where nothing overlapped) and left all the other zones where there was definitely an intersection. And sorry for the confusion, the screenshot I attached is what I want it to look like after the first run!

What iā€™m trying to get is the single area where all the circles overlap (if they donā€™t all overlap then the area where the majority of them overlap). I was going to run a geometry intersect (This should give me the sections where the circles overlap).

Secondly I would then run a geometry intersect the data from the previous one, this will give me the areas where the intersection geometry intersect each other. I would continue this until there is one piece of geometry left.

In practice this will be used with over 600 circles so any sort of manual process in it will take time and open it to human error.

i have a suggestion taking the instead of taking the intersection on the hole.it will be better when you do it as a pairs of circles i will try and let you know :grinning:

1 Like

That would be good! My only consideration is would that work with 600 circles?

Here is an idea for the potential logic to get around comparing the geometry with itself. It just gets the cross product list structure and removes one unique item in sequence from each list so there are never similar instances compared with each other. This way you can set the lacing to shortest/auto on your geometry.intersects node. (The surface.bypatch node would be in place of the [0ā€¦9] code block, and the ā€˜== nodeā€™ represents the geometry.intersect node. I just used these for an example.)

(updated, previous image might not be right)

2 Likes

just try this out this is not the solution but you may get a idea to solve it SampleDyntry this.dyn (87.9 KB)

1 Like

This works for meā€¦

image

Ven Diagram.dyn (8.1 KB)

2 Likes

Thanks Martin! This worked exactly how I want it to work. I now have a few other issues I am trying to solve, I gave them a go but my lack of experience means I donā€™t even know where to start.

I have used your graph and then repeated the process with the intersection geometry to find where that geometry intersects.

My Problem is that there will be over 600 circles (in the real world scenario) and I donā€™t know how many repeats it will need to get to the final piece of intersection geometry (the are all the circles pass through). If I repeat this graph one too many times it then gives me no intersection geometry.

I donā€™t know how many repeats it will need

So you want a node that works recursively like the bi-morph one in my graphā€¦ thanks to @Thomas_Mahon :slight_smile:

Type here. Use Markdown, BBCode, or HTML to format. Drag or paste images.
I cant get it to work, I connect the Circle.ByCentrePointRadius into the curves input. And I connect the Solid.ByUnion into the soid input.

However it shows the Error "Could not create consistent vertex list.