# Fit circle/Arc between 2 lines and point

Hello,

I am trying to fit a circle between 2 line and a defined point .

In Rhino there are 2 ways to achieve this

1. Circle tangent to 3 curves and for the 3rd curve you can assign a point
2. Arc Tangent, tangent, Radius ( can be assigned with points)

Is there anyway to do the same thing in grasshopper ?

Thanks,
A

@arian.hakimi

You can have a look at `Circle Tantan` component (under Curve > Primitive), just need to feed 2 `curves` and a `point` as inputs.

that’s a centerpoint though…
instead of the requirement of using a point on the circle

1 Like

Sorry, my bad. It’s a tricky one then.
Sounds like scripting could help, so I drafted up this Python example, but not sure how much would it be helpful:

circlePTT.gh (12.6 KB)

It uses `Rhino.Geometry.Circle.TryFitCircleTTT` method.

• `tA` parameter is identical to picking the first point using `Circle` command, `Tangent` option.
• `tB` parameter is identical to picking the second point on the first curve.
• `tC` is identical to picking the third point on the second curve, but it’s calculated in Python instead of being parameter because some values will produce invalid circles. When drawing the circle with Rhino command, the third point is actually also calculated because you’re only picking the curve, not the point, so it makes sense to calculate it in Python.
2 Likes

thanks alot for the script,

It works but with a simple trick, I had to move the Line_03 tangential to the ( center arc or defined point) and it works.

See the image below,
again thanks,
A

1 Like

here is another solution based on exact calculation, however it fails if CircleTT fails:

TanTanPt.gh (10.1 KB)

2 Likes