Creating contour from loft

I used Brep.CreateContourCurves() but there are more contours created than the number of section planes. The input planes are 78 and output curves are 91.

extra curves between plane

Hi @neerajsmurali
I’m assuming you are using grasshopper or code for that?
Are you able to provide a model and script?

I am using the C# component in grasshopper but the grasshopper component Brep|plane is also giving the same result…

00.3dm (893.2 KB) (22.7 KB) GrpcLatLon.gha (10 KB) gpx.rar (20.7 KB)

Planes are infinite:

So you need to either use BrepSurface intersection, or check if the result of CreateContourCurves is close enough to your plane origin:

foreach(var plane in planes)
    var contCurve = Brep.CreateContourCurves(loftedSurface[0], plane);
    foreach(var c in contCurve)
      var t = 0.0;
      if (c.ClosestPoint(plane.Origin, out t, 10.0))
} (18.9 KB)

alternatively, if you don’t have the scale in the outer foreach loop (also null checks might save you time debugging)

IEnumerable<Curve> fromBrep = Brep.CreateContourCurves(loftedSurface[0], plane);
Curve result;
    IEnumerable<Curve> filtered = fromBrep.OrderBy(x=>plane.Origin.DistanceTo(x.PointAtNormalizedLength(0.5)))

Thank You @Mahdiyar

Thank You @Thierry_BOCK