# How To Highlight Overlapping Squares/Rectangles

**URL:** <https://discourse.mcneel.com/t/how-to-highlight-overlapping-squares-rectangles/221872>\
**Category:** Grasshopper\
**Tags:** windows\
**Created:** [August 17, 2026, 2:16am UTC](https://discourse.mcneel.com/t/how-to-highlight-overlapping-squares-rectangles/221872 "2026-08-17T02:16:13Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Imran\_Hakim](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/imran_hakim/32/712284_2.png) [@Imran\_Hakim](https://discourse.mcneel.com/u/Imran_Hakim)\
**Post date:** [August 17, 2026, 2:16am UTC](https://discourse.mcneel.com/t/how-to-highlight-overlapping-squares-rectangles/221872/1 "2026-08-17T02:16:13Z")

</div>

Hi all, as per the title, how can I do that? Im attaching my script and some photos.

What I’m trying to achieve is that as the square increases in size, it will overlap with the neighboring squares. I want to determine the degree of overlap and i want to color the overlap area. e.g for an overlap degree of 2 it is blue, for an overlap degree of 3 it is yellow etc etc.

No overlap condition:

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/6/d/8/6d8621737214cd15bd03cfd9ae58818616d62827.png)

Overlap condition:

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/1/3/a/13a9d6d47e2b2576de11eb86cd45ff7e3d83a2ce.png)

[3D Box\_R0.gh](https://discourse.mcneel.com/uploads/short-url/6fGetrGOqxyiurAiBS1201AfFWx.gh) (15.8 KB)

---

<div class="post-metadata">

**Author:** ![Eef\_Weenink](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/eef_weenink/32/764753_2.png) [@Eef\_Weenink](https://discourse.mcneel.com/u/Eef_Weenink)\
**Post date:** [August 17, 2026, 4:37am UTC](https://discourse.mcneel.com/t/how-to-highlight-overlapping-squares-rectangles/221872/3 "2026-08-17T04:37:22Z")

</div>

something like this?

 ![Scherm­afbeelding 2026-08-17 om 06.35.48](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/f/8/d/f8d1f7e3f70580e048482b74da0821082528372a.png)  
 ![Scherm­afbeelding 2026-08-17 om 06.35.36](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/9/c/2/9c2919f61b659459e3ee86ed25542469ced32f8a.png)  
[3D Box\_R0\_EW.gh](https://discourse.mcneel.com/uploads/short-url/5nM0IPNLUqQVEGOdDyABPyjyN8M.gh) (15.4 KB)

---

<div class="post-metadata">

**Author:** ![Imran\_Hakim](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/imran_hakim/32/712284_2.png) [@Imran\_Hakim](https://discourse.mcneel.com/u/Imran_Hakim)\
**Post date:** [August 17, 2026, 5:55am UTC](https://discourse.mcneel.com/t/how-to-highlight-overlapping-squares-rectangles/221872/4 "2026-08-17T05:55:16Z")

</div>

Exactly this, thank you! just an additional question, is there a way i can check the degree of overlapping? say if that particular area is overlapped twice or three times or more?

---

<div class="post-metadata">

**Author:** ![Volker\_Rakow](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/volker_rakow/32/770451_2.png) [@Volker\_Rakow](https://discourse.mcneel.com/u/Volker_Rakow)\
**Post date:** [August 17, 2026, 8:01am UTC](https://discourse.mcneel.com/t/how-to-highlight-overlapping-squares-rectangles/221872/5 "2026-08-17T08:01:21Z")

</div>

[3D Box\_R0 VR 1.gh](https://discourse.mcneel.com/uploads/short-url/yP2OpJqY9GBRtaDurpkpzlHQOPX.gh) (31.5 KB)

---

<div class="post-metadata">

**Author:** ![Volker\_Rakow](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/volker_rakow/32/770451_2.png) [@Volker\_Rakow](https://discourse.mcneel.com/u/Volker_Rakow)\
**Post date:** [August 17, 2026, 12:18pm UTC](https://discourse.mcneel.com/t/how-to-highlight-overlapping-squares-rectangles/221872/6 "2026-08-17T12:18:31Z")

</div>

@Imran_Hakim

I have given you an incorrect solution. I did not pay attention. For what I had done to work, both Cross Reference components would have to be set to `Diagonal`:

 ![Screenshot 2026-08-17 141349](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/f/c/9/fc927afc6fa802de3ea3cf266f7316051ccab9f8.png)

but this would also replicate the intersecting geometries. So better to keep @Eef_Weenink 's solution and do the count check via Collision One|Many:

 ![Screenshot 2026-08-17 141753](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/8/a/0/8a029e2d39324bafce28f688f9cfe8c60750fc04.png)  
[3D Box\_R0 VR 2.gh](https://discourse.mcneel.com/uploads/short-url/ecy6ttesky5KRNCiGgsc4YKIhzu.gh) (22.9 KB)

---

<div class="post-metadata">

**Author:** ![Volker\_Rakow](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/volker_rakow/32/770451_2.png) [@Volker\_Rakow](https://discourse.mcneel.com/u/Volker_Rakow)\
**Post date:** [August 18, 2026, 1:49am UTC](https://discourse.mcneel.com/t/how-to-highlight-overlapping-squares-rectangles/221872/7 "2026-08-18T01:49:20Z")

</div>

![high res test](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/d/3/3/d3388c70d2af65852e934bc3b4cdf689a7e0d4f5.png)  
[3D Box\_R0 VR 3.gh](https://discourse.mcneel.com/uploads/short-url/iluIMyMQqIQp0Vngf3GropwqCg8.gh) (26.4 KB)
