hello gays
i try to make an Standalong Grasshopper Plugin ( means the plugin start at out side of grasshopper )
and want to use Kangaroosolver.dll in pure C# and .netFramework plugin for Rhino
my problem is i don’t know how to start calculating
and after complete the calculating how to read the result position and rotation of my rigidbodys
…
thats my sample code , my app crash without error at end of this code
( i try with one element list of goal and multiple element but result was the same )
if i should use goal.calculate so the calculate method want particle parameters
pleas help me
Interesting! I don’t think I’ve ever seen that approach.
I just inspected the KangarooSolver.dll assembly (maybe I shouldn’t be doing that… but it’s already done ). It looks like KangarooSolver directly depends on RhinoCommon and Grasshopper, so I’m not sure if you’ll be able to do this.
Maybe someone with a little more knowledge can give you more insight!
thanks @alan2
i you right for before using kangarooSolver we must include the rhinocommon , but i think it work without grasshopper refrance (dll) ,
by the way i think the only one can help me is owner of kangoro @DanielPiker
Yes, it should work to call the KangarooSolver.dll from a Rhino plugin, without opening Grasshopper, and when doing this the Grasshopper reference isn’t needed.
The issue I see with the code you show is that the goals do not get their indexing assigned. It’s also not clear where you are initialising your instance of PhysicalSystem.
Here’s a simple example:
var PS = new KangarooSolver.PhysicalSystem();
double tol = 0.0001; // points closer than this will get combined into a single particle
var GoalList = new List<IGoal>();
//Assign indexes to the particles in each Goal:
foreach(IGoal G in x)
{
PS.AssignPIndex(G, tol);
GoalList.Add(G);
}
double threshold = 1e-10;
PS.Step(GoalList, false, threshold);
A = PS.GetOutput(GoalList);
AssignPIndex is the function which looks at the point positions and adds them to the particle list of the PhysicalSystem, and sets the index in the goal. The step method does not work until this indexing is assigned.