public ContactList contact(Graspable obj)
    {
        if (cl==null)
        {
            cl=new ContactList(obj);
        }
        else
            cl.resetList(obj);

        Point3d[] PN=new Point3d[13];
        Plane[] PL=new Plane[13];
        setHandFrame();
        addseg_and_child(index,null,PL,PN,obj);
        Log.dprintln("Number of intersections of index "+cl.contc, Main.DLEV);
        addseg_and_child(thumb,null,PL,PN,obj);
        Log.dprintln("Number of intersection of index+thumb:"+cl.contc, Main.DLEV);

        // note that the thumb intersections are counted twice for two joints
        // at the thumb vertex
        addseg_and_child(middle,null,PL,PN,obj);
        addseg_and_child(ring,null,PL,PN,obj);
        addseg_and_child(pinky,null,PL,PN,obj);
        Log.dprintln("Number1 of intersection of all fingers (thumb counted twice):"+cl.contc, Main.DLEV);

        double side=(VA.inner(palmNormal,obj.objectCenter) + palmD);
        if (side>0)
        {
            int k=obj.lineIntersection(obj.objectCenter, palmNormal, PL,PN);
            Log.dprintln("@@@@@@@@@@@@@@@ OBJ INTERSECTION COUNT:"+k, Main.DLEV);
            Point3d G;
            // pick the one closes to the palm
            if (k==1 || k==2)
            {
                if (k==1)
                    G=PN[0];
                else if (VA.dist(PN[0],palmCenter) < VA.dist(PN[1],palmCenter))
                    G=PN[0];
                else
                    G=PN[1];

                double d=VA.dist(G,palmCenter);

                // close enough
                if (d<palmThreshold)
                {
                    Log.dprintln("Object facing the palm and close. Good.[d="+d+']', Main.DLEV);
                    cl.addContact(palmNormal,1);
                }
                else
                {
                    Log.dprintln("-------->Object is too far to the palm:"+d, Main.DLEV);
                }
            }
            else
            {
                Log.dprintln("----------> object cannot be intersected!!!!", Main.DLEV);
            }
        }
        else
        {
            Log.dprintln("Object not in the right side of the hand!", Main.DLEV);
            cl.graspCost=1e30;
            Log.dprintln("---------------------> Cost of grasping:"+cl.graspCost, Main.DLEV);
            return cl;
        }

        double cost=cl.searchNewton();
        Log.dprintln("---------------------> Cost of grasping:"+cost, Main.DLEV);
        double Fnorm=VA.norm(cl.netForce);
        Log.dprintln("Net Force  :"+cl.netForce.str()+" norm:"+Fnorm, Main.DLEV);
        Log.dprintln("Net Torque :"+cl.netTorque.str()+" norm:"+VA.norm(cl.netTorque), Main.DLEV);
        return cl;
    }