Circle Tangent to three curves

Hello Everyone,

I would like to use the grasshopper component (circle tan tan tan) within C#. inside the grasshopper component, the inputs are three curves and a point as circle center point guide. But within C# I only find the method (TryFitCircleTTT) and it asks for three curves and three parameters on given curves. Most of the time the outcome is an invalid circle. I would like to know how does the grasshopper component (circle tan tan tan) works so I can use it in C#.

cheers,

Mahan

You can use NodeInCode to exactly generate same result as grasshopper components:

private void RunScript(Curve a, Curve b, Curve c, Point3d p, ref object A)
{
    var cttt = Rhino.NodeInCode.Components.FindComponent("CircleTanTanTan");
    if(cttt == null) return;
    var cttt_function = (System.Func<object,object,object,object,object>) cttt.Delegate;
    A = cttt_function(a, b, c, p);
}


CircleTanTanTan.gh (14.0 KB)

2 Likes