IGoal Object initialisation is forcefully asking integer point references instead of the point3d arguments even if I explicitly declare the types. Should it except Points3d as in the example declaration below, or should one always work with point indices when dealing with goals?
I am assuming that integer type initialisation is referring to the point index from the discretised & duplicate free point system. How can I convert a point to the Physical System point index?
namespace KangarooSolver.Goals
{
public class Hinge : GoalObject
{
public double Strength;
public double RestAngle;
public Hinge();
public Hinge(int P0, int P1, int P2, int P3, double RA, double k); //Visual studio interpreting that I am referring to this initialisation
public Hinge(Point3d P0, Point3d P1, Point3d P2, Point3d P3, double RA, double k); //Even if I am aiming to use this.
public override void Calculate(List<Particle> p);
}
}
You can create goals using either Point3d or integer PIndex.
If using Point3d though, you need to also assign the indexing before calling Step.
The AssignPIndex method is usually the easiest way of doing this automatically (and what is called in the standard non-scripting solver component).
Yes, I indeed was working under the impression that both could be used, thanks for confirming. My issue is that Visual Studio complains to me that it is expecting (int) when I clearly give it the (Point3d) arguments preventing me from creating them. In the hinge example above I get this: