public void computePowerGraspAffordance(final ArmHand hand)
    {
        if (hand.getSegmentIndex("RING")<0 || hand.getSegmentIndex("THUMB2")<0)
            return ;

        lastPlan=POWER;
        GRASP_TH=40; BASERATE=0.03; RATE_TH=0.15;
        final Plane[] PL=new Plane[6];
        final Point3d[] PN=new Point3d[6];

        //Avoid objects
        setAvoidance();

        //Turn trace on
        //Main.toggleTrace(hand.armHandNumber);

        //Compute object center and radius
        setPlaneProperties();

        //target angles to be achived
        target=new Point3d[3];
        //the joints that corresponds to target
        tIc=0;
        //ring knuckle
        tIndex[tIc++]=hand.getSegmentIndex("RING");
        //thumb joint
        tIndex[tIc++]=hand.getSegmentIndex("THUMB2");

        // Origin
        final Point3d ORG=VA.add(root.limb_pos,root.joint_pos);
        VA._scale(ORG,0.5);

        /**
         * Find ring finger intersection
         */
        // Opposition axis
        Point3d opposition;
        if (ORG.x<0)
            opposition=VA.normalize(new Point3d(1,1.13,0));
        else
            opposition=VA.normalize(new Point3d(0,1.13,-1));

        // Get intersection of object with line going through origin in direction of opposition axis
        lineIntersection(ORG, opposition, PL, PN);
        VA._resize(PN[0],PN[1],1.4);

        final Point3d tempRi;
        if (PN[0].z-PN[0].y < PN[1].z-PN[1].y)
            tempRi=VA.subtract(PN[0],ORG);
        else
            tempRi=VA.subtract(PN[1],ORG);
        Log.println(" ring Intersection:"+tempRi.str());

        // Find thumb intersection
        // Opposition axis
        if (ORG.x<0)
            opposition=VA.normalize(new Point3d(0,0,-1));
        else
            opposition=VA.normalize(new Point3d(-1,-1.13,0));

        lineIntersection(ORG, opposition, PL, PN);
        VA._resize(PN[0],PN[1],1.4);

        final Point3d tempT;
        if (PN[0].x+PN[0].z < PN[1].x+PN[1].z)
            tempT=VA.subtract(PN[0],ORG);
        else
            tempT=VA.subtract(PN[1],ORG);
        Log.println(" thumb Intersection:"+tempT.str());

        int pnc=0;
        PN[pnc++]=tempRi;
        PN[pnc++]=tempT;

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

        if (pnc!=tIc)
        {
            Log.println("POWER grasp error!");
            System.exit(0);
        }

        for (int i=0;i<pnc;i++)
            VA._add(PN[i],ORG);
        target=PN;

        objsize=estimateSize();
        Main.toggleTrace(hand.armHandNumber);
        Main.refreshDisplay();
    }