# Delete intersecting lines script?

**URL:** <https://discourse.mcneel.com/t/delete-intersecting-lines-script/166539>\
**Category:** Grasshopper\
**Tags:** windows, rhino7\
**Created:** [October 2, 2023, 1:23am UTC](https://discourse.mcneel.com/t/delete-intersecting-lines-script/166539 "2023-10-02T01:23:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![crepaart](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/crepaart/32/502976_2.png) [@crepaart](https://discourse.mcneel.com/u/crepaart)\
**Post date:** [October 2, 2023, 1:23am UTC](https://discourse.mcneel.com/t/delete-intersecting-lines-script/166539/1 "2023-10-02T01:23:01Z")

</div>

Hi there

I have a lot of curves that intersect with one another, and it would be great if there was a way to delete one of the curves that are intersecting… (trying to remove overlapping lines for visual clarity when i zoom out, the intersecting lines tend to create black spots)

is there a simple grasshopper definition that can achieve this?

any help would be much appreciated. 🙂

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/b/f/f/bffb2b3d2b95571203ec64250d0a868358880b23.png)  
 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/0/6/4/0645eb7af509c098c4e2ccabf7485fc97ae86228.png)

---

<div class="post-metadata">

**Author:** ![saeed\_hasan\_zadeh](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/saeed_hasan_zadeh/32/632496_2.png) [@saeed\_hasan\_zadeh](https://discourse.mcneel.com/u/saeed_hasan_zadeh)\
**Post date:** [October 2, 2023, 4:11am UTC](https://discourse.mcneel.com/t/delete-intersecting-lines-script/166539/2 "2023-10-02T04:11:18Z")

</div>

Without .gh ?

---

<div class="post-metadata">

**Author:** ![PeterFotiadis](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/peterfotiadis/32/472316_2.png) [@PeterFotiadis](https://discourse.mcneel.com/u/PeterFotiadis)\
**Post date:** [October 2, 2023, 9:13am UTC](https://discourse.mcneel.com/t/delete-intersecting-lines-script/166539/3 "2023-10-02T09:13:13Z")

</div>

> [@crepaart](#):
>
> any help

That’s a classic hard flat Clustering task (where **criterion** is Crv/Crv Ccx Events). I have tons of examples for any Clustering task imaginable … but are all done via C# (i.e. not a single native component on sight). Any similar Clustering returns an indices Tree (where all Items have **at least** one other item related via **criterion** [i.e. as an option you can control result, say, via N of Ccx Events etc]) … meaning that you can do anything you like (for instance do a closed Crv bool union, delete all items except one [or more] etc etc).

Anyway If you want an indicative C# notify.

---

<div class="post-metadata">

**Author:** ![saeed\_hasan\_zadeh](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/saeed_hasan_zadeh/32/632496_2.png) [@saeed\_hasan\_zadeh](https://discourse.mcneel.com/u/saeed_hasan_zadeh)\
**Post date:** [October 2, 2023, 2:26pm UTC](https://discourse.mcneel.com/t/delete-intersecting-lines-script/166539/4 "2023-10-02T14:26:29Z")

</div>

seems in such case you have to use _multi-thread_ enabled operations.  
-using point groups on circles center with radius of each circle + tolerance as distance and then culling top %n of groups per center member quantity  
-or using curve|curve option  
-or going with point-on-curve component.  
-another way is preventing curve overlap from first and making them on integer grid for less float operation.  
-or using multi-thread-union! .  
-or better performance with scripting like said above.
