Ellipse through points...no command

Indeed some judgement is needed here, and some reasonable approximations. Without knowing the actual purpose of this exercise, it’s all a bit in the air… in the following, bounding box was used to approximate major axes of the large ellipses

I think raja has it as close as is possible with that given data.

If you have more complete data, you can do something like what I’ve done in the attached file. (You can just turn on/off the layers top to bottom to see the progression)

I drew an ellipse, and then rotated it at a random angle. I then drew a line across part of it, that cuts it at a random angle. I rebuilt that curve, so that the original “data” is lost - this is to represent the “dumb” data of the photograph, so you can’t just cheat, turn the points on and get all the info you need. I then did Line->Perpendicular->2Curves and picked both sides of the ellipse, roughly near where the major axis is. Then I drew a line perpendicular from the mid point of the major axis, to create the minor axis. Then I used Ellipse-From Center, using the Major-Minor axis geometry. So for this method, you’d have to trace the photo in the area of major axis on both sides in order to Line->Perpendicular->2Curves to work. Sounds like a lot of work, right? Personally, I’d rather just do what Pascal says - use the Gumball and Move/Scale/Rotate a circle so it matches with the photo data.

It should be pointed out that ALL of the methods suggested here by myself and others are different ways of getting to the exact same data - the major and minor axes of the ellipse.

The problem with having only half the ellipse as you do is that there is no guarantee that either the major or minor axis is shown. So, it’s basically a best guess at that point. raja’s best guess is a good as it gets imho.

InferredEllipse.3dm (54.9 KB)

Hi
Pascal, sorry I didnt realise, I took it that the gumball usage had extra powers to solve this, not knowing of its secrets, and yes I went over to using scale1D to keep the top etc, still tricky though, as I said unfamiliar with gumball, so please excuse me there, now wiser on the centre move, cheers Mitch.

Skyg agreed need at least half an elipse in this case, which was more of an extreme compared to previous tasks regards what was viewable.
as you say Pascals method is the best approach here.

raja…hey hey :smile:
I was thinking axis horiz, of course, angle it to what we do have. I had in my mind established a rule that the axes would have to be horiz and vert, because if one photos a circle thats where the elipses axes would be, but you have a spinner showing result valid, and in fact the curvature is visually like the original.

So one could look for an axis on an angle and progress with that.

Purpose of exercise was too involved to explain fully but I had need to establish the location and angle between some nuts on the spinner backplate and needed to draw lines from them to the spinner centreline/thrustline to assist.

A lot I see viewing this task, assume they also need to know, so hope its proving useful,

Steve

It is possible with math to find the equation of an ellipse which is the best fit to a set of six or more points, even if all the points are located in a single quadrant of the ellipse and neither major nor minor axis is visible. This is similar to how Rhino can find the circle which fit through any three points using Circle with the FitPoint options. An ellipse requires a minimum of six points compared to a circle which only requires three. Currently it appears that Rhino does not have this capability for ellipses.

An algorithm for fitting the ellipse using a minimum of six points could work like this:

  1. Determine the plane of the ellipse. Rhino already has this capability in PlaneThroughPt.
  2. Pull the points onto the plane.
  3. Set a temporary physical (not parameter) coordinate system with two axis on the plane…
  4. Find the equation of the ellipse on the plane in the temporary coordinate system which minimizes the error in distance between the ellipse and the points. This is a six variable, non-linear regression problem which will need iteration to solve.
  5. Transform the equation of the ellipse into NURBS format in the original coordinate system.

Edit - Step 2) put in.

Yea, I briefly looked at some literature like this one before answering further up:

It spoke of an optimization problem and thus I thought of Galapagos in Grasshopper. Of the two definitions posted in by others in this thread, I find that David’s is very easy to use…

I don’t have any trouble getting sub-2mm accuracy by just using a diam ellipse to recreate this broken tracing of an ellipse. Yes would be lovely to have a more automatic option such as available through the ‘circle _3point’ command, but whatever.

Hi,

attached an example of need for ElipseThroughPoints command as easily selected as circleThroughPoints.

I have to establish the size of an eliptical tank and can only see indication of its welding onto a bulkhead.

Anyone care to solve the fit of the eliptical tank weld I can see traces of, to establish best fit elipse ?

The outside edge of the tank will be at the inner weld points, but there is more of the outer weld edge visible, so I shall adjust the blue based on results from blue and red.

Centre axis elipse is shown, blue outer lines represent the known width and top.

I just wish we had a simple command . with 886 views a few others might also be interested !

RequirementElipseThroughPoints.3dm (46.5 KB)

amended original 3dm as points lower left were spurious !
Steve

Do you know enough about the dimensions of the real object that you could model it in an orthographic view based on circles then rotate it in space to derive your ellipse using Make2D?

Dennis

I know its width but not height,
how would I do that, create a circle at 90 deg to the elipses plane then rotate circle3d whilst looking at it in a different ortho until a visual match, how do I get it to fit points, visual ?

When CAF is a mathematical geometry sort of thing, visual seems a little basic.

Do any CAD progs have elipseThroughPt ?

Steve

Hello!

I know this is an old thread, but if anyone else in the future is looking through this thread for an answer, I would suggest this tool.

I use it for tracing scans imported from a prodim proliner, and it’s been pretty useful so far.

1 Like

Hi,
thanks for this. I see rhp and also rhi files, not sure which I need. (need to remind myself how to apply this file after downloaded)

V5

I also could do with best fit elipse through a number of points., where clearly the points form an elipse, as in my initial image.

Steve

This must be a record for ‘blast from the past’ post!

1 Like

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)