Closed Inner and Outer Curves

For a given set of curves, how do you determine a subset of curves that are closable with a given tolerance and then test to see which one is the greatest loop and how many of the other closed loops are within this biggest loop?

Compare the distances between the start and end points. If they are within your tolerance…

var distance = curve.PointAtStart.DistanceTo(curve.PointAtEnd);
if (distance <= tolerance)
{
  // todo...
}

If by ‘greatest’ you mean longest, then use Curve.GetLength to get the lengths and compare values.

To determine the relationship of two planar closed loops, use Curve.PlanarClosedCurveRelationship.

– Dale

I will try that and let you know, thanks Dale