Fit points to ellipse

Hi,

Is there any .Net or Rhinocommon method that approximates an ellipse from a set of points?

Similarly to fit circle from points, but for ellipse?

I tried to search in google queries but what I found was based on C++ with additional dependencies. Maybe someone have already had this issue?

It’s been discussed, yes…

-w

I made a Kangaroo goal that can pull points onto a common ellipse, given an initial guess for the 2 foci.
ellipsefitting.gh (8.3 KB)

For some reason I didn’t figure out yet, it doesn’t work if you anchor the points to fit to though.

3 Likes

Dear Daniel,

Thank you for the Kangaroo Goal, but I would like to ask if there is any mathematical way of fitting points to an ellipse when no focus points of ellipse are given?

I am searching for a similar method to fit points to circle, but for ellipse.

Dear Wim,

Do you know any implementation of the paper you mentioned?

Hi Petras - no, I don’t know if that is implemented in an application.

I only mentioned it because it inspired me to try to use Galapagos to solve that. I see that the uploaded files in that thread no longer are available but now found David’s image and GH definition. I’ll upload them here just in case …
-wim


ellipsefit.gh (10.0 KB)

if you have points and you want to fit an ellipse to it. there is no option in grasshopper/rhino to do it directly so i wrote a python script in grasshopper to do it. I have attached the files also here is the github too:
Grasshopper_ellipse_fit_code.py (14.3 KB)
example_gh_elliplse_fit.gh (11.8 KB)
example.3dm (24.5 KB)