public void computePrecisionPinchAffordance(final ArmHand hand)
    {
        if (hand.getSegmentIndex("INDEX2")<0 || (hand.getSegmentIndex("THUMB3")<0 &&
                hand.getSegmentIndex("THUMB2")<0))
            return ;
        Log.dprintln("Planning precision...", Main.DLEV);
        lastPlan=PRECISION;
        GRASP_TH=50; BASERATE=0.04; RATE_TH=0.25;
        resetAvoidance();
        final Plane[] PL=new Plane[6];
        final Point3d[] PN=new Point3d[6];
        final Point3d handdir;

        setPlaneProperties();

        target=new Point3d[3];  // target angles to be achived

        tIc=0;                  //  the joints that corresponds to target
        if(hand.getSegmentIndex("THUMB3")<0)
            tIndex[tIc++]=hand.getSegmentIndex("THUMB2");
        else
        tIndex[tIc++]=hand.getSegmentIndex("THUMB3");
        tIndex[tIc++]=hand.getSegmentIndex("INDEX2");
        tIndex[tIc++]=hand.getSegmentIndex("WRISTx");

        Point3d ORG=objectCenter;

        //Main.toggleTrace(hand.armHandNumber);

        final Point3d opposition;
        if (ORG.x<0)
            opposition=Z.duplicate();
        else
            opposition=X.duplicate();
        lineIntersection(ORG, opposition, PL, PN);

        final Point3d dP;
        final Point3d ppp;
        final Plane pppl;
        if (ORG.x<0  && PN[0].z>PN[1].z  || ORG.x>=0 && PN[0].x>PN[1].x)
        {
            ppp =PN[0]; PN[0]=PN[1]; PN[1]=ppp;
            pppl=PL[0]; PL[0]=PL[1]; PL[1]=pppl;
        }

        VA._resize(PN[0],PN[1],1.4);
        lastopposition=VA.normalize(VA.subtract(PN[0],PN[1]));

        dP = VA.subtract(PN[1],PN[0]);
        handdir=VA.subtract(hand.wristx.limb_pos,PN[0]);
        final Point3d t1=VA.cross(handdir,dP);
        final Point3d wr=VA.normalize(VA.cross(dP,t1));
        VA._scale(wr,250);
        PN[2]=VA.add(wr,VA.center(PN[0],PN[1]));

        target=PN;

        objsize=VA.dist(target[0],target[1]);
        //Main.toggleTrace(hand.armHandNumber);
    }