Is there a way to find the centerpoint of a sphere, if you have three points in a space and the radius of the sphere.
The 3 points have to be on the surface of the sphere and cant be inside the sphere.
I have searched far and wide but i cant find a solution. below what i am trying to do:
I have 3 points:
I have a sphere with radius R that is placed on these three points, the points support the sphere on the surface so it cant fall through any point.
I want to find the centerpoint of that sphere:
No, as the 3 points define infinite spheres. You can instead do the exercise with a circle.
Circle.ByBestFitThoughPoints
> Circle.Center
If you have 4 points instead you can use the sphere equivalent.
Three points on a surface with a given radius define a maximum of two spheres, no?
Go grab a balloon, your coffee cup, and a dry erase marker.
Drink any coffee in the cup.
Mark 3 points on the rim of the coffee cup with the dry erase marker. These are the points you’re providing.
Now blow up the balloon but don’t tie it off - just pinch it closed.
Rest the balloon atop the coffee cup. This is a sphere that touches your 3 points.
Now let some air out of the balloon. It’s another sphere touching your 3 points.
Now let some more air out. It’s another sphere touching your 3 points.
Now let out the air slowly and notice how the sphere always fits until it’s small enough to pass though the 3 points.
Now wipe the marks off your cup, fill the cup back up, and get back to work. 
2 Likes
Haha yeah when you put it like that its infinite spheres, but my radius is predetermined.
For three points and a given radius, i would need to find the centerpoint.
So with the formula/method im looking for, for any amount of air in the baloon we would be able to find the centerpoint of the sphere
So assume we have a graph, with three fixed points and a radius as an integer slider
Ah! Totally missed that. Sorry! Let’s get you squared away.
The logic you need:
- Draw a sphere at each radius
- Extract the surface of each.
- Intersect the first surface with the second surface and take the one item (a circle) out of the list.
- Intersect the circle with the 3rd surface.
- Any resulting point is a possible sphere with the given radius.
- If 0 your radius is too small
- If 1 your sphere is the same as the circle which hits all 3 points.
- If 2 you’ll need to decide which to work with - positive side of the plane formed by the points or the negative side.
Here is some design script to do the same:
def sphereFinder (pnts: Point[], radius: double)
{
surfs =
List.FirstItem(
Sphere.ByCenterPointRadius(pnts,radius).Explode()@L2<1>
);
intersects =
surfs[0].Intersect(surfs[1])[0].Intersect(surfs[2]);
return intersects;
};
1 Like
Ahh man, wish I left the office a little later haha. Thanks Jacob, I’ll check tomorrow!
1 Like
This is so simple yet clever.. I knew i could find the center of a circle on a plane by drawing two circles at the points along the perimeter, no idea why i didn’t realise you could do this with spheres..
Thank you Jacob!
1 Like
Just one more follow up..
Can you point me in the right direction so i can get the surface of the circle that is touching the three points?
I want to drop the sphere and keep only the relevant surface, so it would look something like this:
Likely Geometry.Trim, where the tool is the plane built from the 3 points and the discard side is any point translated slightly towards the center.
That said, it looks like you are building a fabric structure, and those shapes aren’t actually spherical in nature, so you might want to rethink the geometry creation. DynaShape might be a better solution from an end result and product speed standpoint.