Kangaroo Solver Goal Overload issue



I noticed that when the build of RhinoCommon/Grasshopper is not exactly the version of the Rhino installed I get some build errors with recognizing overloaded goal objects from KangarooSolver.dll.

 G = new KangarooSolver.Goals.Hinge((Point3d)P1[i], (Point3d)P2[i], (Point3d)P3[i], (Point3d)P4[i], (double)0, (double)strengths["rigid"]);
Severity Code Description Project File Line Suppression State
Error CS1503 Argument 1: cannot convert from ‘Rhino.Geometry.Point3d’ to ‘int’ xxxxx [path to file].cs 1061 Active

I get a bunch of errors like the one above expecting indexes of points rather than the points themselves in a Hinge goal for example. This issue disappears when the version of Rhino Common/Grasshopper is the same as the Rhino version installed.

Note: I am referencing the KangarooSolver.dll from my Rhino installation. Should I add the KangarooSolver.dll to the project? If so, where can I get the latest file? Or is there a better way to force the correct goal object overload to be considered when building the project?

At the time of writing the rhino version is 7.33, while RhinoCommon/Grasshopper are on version 7.32 (and there is also 7.34 pre release).

I managed to solve the issue by referencing the 7.32 version of KangarooSolver.dll guess this is a general issue when a module has dependency (in this case rhino) that is more recent than the version you are using. Still not sure why it flags the overloads as they are a symptom of the larger problem i.e my local Rhino installation had KangarooSolver.dll calling for version 7.33 when there is no version 7.33 of RhinoCommon available yet (only 7.32 and 7.34-pre-release)

1 Like

Thanks for pointing out the issue and for posting the solution you found. I’m not sure exactly what’s going on here but will try and figure it out.

1 Like

@DanielPiker I got a DM from @KaneBorg - I don’t understand this either. Do you have a YT issue going for this? I wonder if we need to get @curtisw or @stevebaer involved to understand the assembly referencing problem?

Thanks @brian
I still don’t know what’s causing this. Just created a YT for it https://mcneel.myjetbrains.com/youtrack/issue/RH-77870/Build-errors-when-referencing-KangarooSolver.dll

Hey @KaneBorg,

Yes this is expected. You can’t add a reference to KangarooSolver.dll v7.33 when referencing RhinoCommon/Grasshopper 7.32 nuget packages. Usually we publish the nuget packages of our released version of Rhino when they come out, but that appears to not have been done for 7.33. @will may know why. 7.34 has been published now so you should be able to use that version instead.

That being said, if we want KangarooSolver.dll to be usable by 3rd party plugins we should add that to our Grasshopper nuget package, which I have added a YT for here: RH-77889.

Hope this helps!