Circle Fit > No sphere could be fitted

circle-fit-no-sphere-could-be-fitted.gh (3.6 KB)

The points I’m feeding are all duplicates so it is my mistake but the error message should probably still say No circle….

Well, I mean the reason that fit circle fails to create a circle might be because the points can’t be fit to a sphere, so… :person_shrugging: But I understand what you mean.

Is there is an intermediary step to getting the fit line as there is with the circle? I still think you are right that it should say circle in stead of sphere.

I have no idea? Does the circle fit use a sphere fitting first?

I would imagine. Or what I was proposing above is that it might, which would be an explanation as to why it says sphere instead of circle.

Yup. That would speak to the idea that Fit Circle uses a sphere, as 3 points are required to define a circle and 4 points a sphere.

I’m looking forward to a response from a developer

Given that circle fit produces an oriented circle, i.e. not necessarily one in the CPlane, the idea of a sphere being involved seems plausible.

The approach of a sphere and a plane as underlying method was pointed out a few times:

Interesting…

The linked thread is from 2018. Is the information in it still current, given a post from @dale that

If I was creating an algorithm to fit a circle to a set of points, with the points not necessarily being planar, it would be:

  • Fit a plane through the points.
  • Pull the points onto the plane.
  • Create a 2D coordinate system on the plane.
  • Fit a circle to the points using a least squares fit.
  • Transform the circle to world coordinates.

Thanks @martinsiegrist - https://mcneel.myjetbrains.com/youtrack/issue/RH-94705