# Divide a list of curves into groups based on the fact they are forming a poligon or not

**URL:** <https://forum.dynamobim.com/t/divide-a-list-of-curves-into-groups-based-on-the-fact-they-are-forming-a-poligon-or-not/56689>\
**Category:** Geometry\
**Tags:** python\
**Created:** [October 29, 2020, 3:26am UTC](https://forum.dynamobim.com/t/divide-a-list-of-curves-into-groups-based-on-the-fact-they-are-forming-a-poligon-or-not/56689 "2020-10-29T03:26:40Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Ewan\_Opie](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/ewan_opie/32/77070_2.png) [@Ewan\_Opie](https://forum.dynamobim.com/u/Ewan_Opie)\
**Post date:** [October 29, 2020, 5:43am UTC](https://forum.dynamobim.com/t/divide-a-list-of-curves-into-groups-based-on-the-fact-they-are-forming-a-poligon-or-not/56689/2 "2020-10-29T05:43:02Z")

</div>

Depending on your data set you could try some design script grouping of curves.

> [@Grouping Curves with Design Script](https://forum.dynamobim.com/t/grouping-curves-with-design-script/15122/3):
>
> Edit: Update for Dynamo 2.15.XX def grpCrvs(crv:var[]..[],maxGap:double = 0.0) { dis1 = (crv.StartPoint)\<1\>.DistanceTo(crv\<2\>)\<=maxGap ||(crv.EndPoint)\<1\>.DistanceTo(crv\<2\>)\<=maxGap; ind1 = DSCore.List.AllIndicesOf(dis1\<1\>,true); bln1 = true; ind2 = [Imperative] { while (bln1) { cnt1 = DSCore.List.Count(ind1); ind1 = grpIndx(ind1); cnt2 = DSCore.List.Count(ind1); bln1 = cnt2!=cnt1; } return = ind1; } …

Are your points or curves all located in the same flat plane? Are you just looking to sort radially from base points at first? Would you be able to post an image of your workspace or what you have tried? As well as a test file?

There are a few statistical outliers removal algorithms out there (mainly for pointclouds) but your workflow probably only requires a simple recursive algorithm.

---

_[View the full topic](https://forum.dynamobim.com/t/divide-a-list-of-curves-into-groups-based-on-the-fact-they-are-forming-a-poligon-or-not/56689)._
