Contiguity Analysis of boxes in Grasshopper

Dear Community,

I am currently researching how to do a contiguity analysis regarding the form captured here.

What I am trying to analyze is, finding any cubes that is not adjacent to any other once in order to eliminate them. Or eliminate the once with only one to two neighbors …etc

Is there a logic or a way to go about it in grasshopper ? Currently the form only exist in this rhino file.


240303_Testing for Contiguity.3dm (16.3 MB)

So boxes that touch only one corner are not adjacent?


Contiguity_2024Mar3a.gh (25.3 KB)

Here is another way to look at the same thing. Point Groups are branches of boxes…


Contiguity_2024Mar3b.gh (29.3 KB)

Yes. Only the once that touch the surfaces, not corner or edges.

Also thank you so much for the different solutions. I will be looking at them now.

They is just one solution: PGroups (Point Groups).

P.S. In other words, the code in version ‘Mar3a’ that was removed in version ‘Mar3b’ was to show only the longest branch, the boxes in the largest group of center points.

1 Like

Thank you for your solution. It happened to worked out perfectly for me.

But here is another question, would you happen to know how to remove all inner faces and leave only the outer faces as I am preparing to test the shape with 3D printing ? I tested Boolean Union in Rhino and that clearly will fail as not all cubes are touching.

I figured out a way to remove the duplicates inner faces but when using that as an index again with the item list, it won’t remove the other version of faces.


Contiguity_2024Mar3b.gh (27.9 KB)
240303_Testing for Contiguity.3dm (16.2 MB)

I didn’t take the time to look at your code, sorry, or think about this much…

But you can enlarge the cubes slightly to make SUnion work, then apply FMerge (Merge Faces) to get this, using version ‘Mar3a’ of what I posted a week ago:

Genius, thank you very much. I didn’t think about solving the issue in such a simple way.

1.005 scale factor probably depends on ‘View | Display Options… | Units | Absolute tolerance’? A smaller scale factor is better, if possible.

1 Like

You were not far, In order to duplicates all points/faces you have to use “Cull All”

2 Likes

Uh that amazing. I didnt even know that the Cull Duplicate component has that feature :heart_eyes:

Thank you alot :pray:

1 Like

Very nice, but it works only in R8 for some reason…? Fails to create a “Closed Brep” in R7. Units Absolute Tolerance is the same in both: 0.01

I didn’t try in R7 as it was in R8 (area component), it is a bit strange because this is quite classical but i Perhaps used mesh. Mesh could be far less heavy in calculation and size !

If welded no Naked edge

Contiguity_2024Mar3b Meshes.gh (305.2 KB)

1 Like

Amazing. Thank you again :heart_eyes: