Co-circular constraint

Hi Daniel,

I was wondering whether you have implemented a co-circular constraint in K2 similar to the one in Shape-Op here:

I had a quick look through the forums and repositories but couldnt find anything.

Many thanks

Hi Mathias,
It should already be possible to do this by combining cospherical and coplanar (since if the points share both a plane and a sphere they must share a circle).
If this doesn’t work well, a direct co-circular goal would be fairly simple - just like this:

But replacing the fit sphere with fit circle.

Thanks. I got this working by adapting the CoSpherical code. Although it is somewhat slow due to the way Rhino.Common calculates fit circle…

Do you know why I am having trouble running this in Rhino 6?


Co-circular test (20.5 KB)

Hi Mathias,

I’d forgotten that there isn’t a direct circle fit method in RhinoCommon.
If using a combination of sphere fit/plane fit/intersect like that, then I don’t think there is actually any advantage to having it in a custom goal - it is probably faster to use the existing co-spherical + co-planar goals, as that way you avoid having to explicitly calculate the intersection curve.

What error are you getting in Rhino6?
It might just be about making sure that the scripted goals are referencing the same copy of KangarooSolver that is being loaded by 6.

Yes, of course. I need to reference of KangarooSolver.dll that comes shipped with Rhino 6…

Thanks again.

@DanielPiker the new method is working nicely now.
Definitely worth adding to the core library, I think.

Method for fitting a circe through a set of points