Where the green points are the majority of points which makes the correct circle and the red points are either outside or inside the circle.
Using the fit circle through point command on all the points from the beginning will obviously result in the circle taking the red points into consideration and offsetting the circle either inside or outside from where it needs to be.
So I’m trying to get only the green points (in Grasshopper) so I could fit a circle through them.
take centroid of all the points, calculate distance of each point to centroid, pick soem values to use as R of circle, use R to filter distance, use those points to fit your circle
It’s interesting because your looking at the most common radius gives you a value of 101.75 but using @markz 's suggestion of determining the centroid gives an average distance of 109.75.
Just to be sure I started with a point set where I knew the exact origin. My solution creates 3 point arcs and extracts the number of times a radius occurs.
I assume by “take centroid of all the points” Mark means average… This is not precise.
Thank you @anon39580149, The separation of layers was just for the sake of demonstration in different colors.
What I really have to start with is a deformed circle curve that I need to make as perfect as it could be, so I was thinking to get the curve’s points and create a new circle out of the majority of the points which are on the same “virtual circle”…
Speaking about accuracy @akilli I don’t think the center of the existing curve (or its points) is the center of the most accurate circle that could fit there.
which makes @martinsiegrist solution maybe more relevant but it got me this cool thing:
but I can’t tell you I figured the solution out yet
I was thinking of a method to someway evaluate if any point is on an arc together with its next and last points and somehow create a list of points which are the most common on arcs which shares the same radius… and then it could really get the “common points”… Does it make any sense?
If the points are not derived from actual circles and do not have a clear center point, some sort of rounding is required. I wouldn’t create circles from three consecutive points shuffle the list and create lists with three points each.
Here’s a file with three different ways to compare the results.
Looking For the Common Radius or angle between points.gh (24.4 KB)
Thank for your help! it’s almost perfect… I’ve also rebuilt the curve to Degree 3 to smooth it out and it worked even better and got an more accurate result.
You are right, one approach is rounding the circle but as your solution is great, it still takes all points into consideration. I was wondering if I could get it to be even more accurate by ignoring the points which are not the common points of the circle that could virtually fit through most points.
So I was also trying two other things, assuming the points are derived from a curve which is almost a real circle, I even had it rebuilt with Degree 3 to smooth it out and was trying to compare consecutive arcs (more like all arcs from any 3 points) which didn’t produce a common radius as you can see.
I’ve also tried to make the arcs larger, spanning 5 points for example but still didn’t get a common value.
and also tried to rebuild the curve to Degree 3 to smooth it out a bit and rebuilt again to Degree 1 to convert it to straight lines and then tried to compare the angle between any two consecutive lines.
Still no common value appeared… but a wide range.
I was thinking this direction should make sense but I guess I’m still missing something.