Surface.PerimeterCurves to Circle

I’m generating a surface where I’ve got a round pipe intersecting a plane. I’d like to determine the size/diameter of the surface. The surfaces that will be generated will all be round. Surface.Perimeter curves generates the linework/curve that I’d like, but I’m not sure how I’d go about getting the diameter. I was thinking Geometry.BoundingBox might work; taking the min and max point and generating a line between the two. However, the points generated from Geometry.BoundingBox would be pulling points in the outer extents that would form a square, not a circle. Any thoughts?

One possible method would be to get the coordinate system of the surface and project from the origin to the perimeter curves.

While that would work, I would like to ask why you aren’t just getting the dimension from the pipe directly? Much faster (no computational overhead) and more reliable (it’ll always be right even if your plane isn’t perpendicular to the pipe, an easy thing to break causing ovals and bad measurements, instead of circles).