void power()
 {

  if (index[2]<0 || thumbTip<0) return ;

  if (HV.DLEV>0)System.out.println("Planning power...");
  lastPlan=POWER;
  GRASP_TH=40; BASERATE=0.03; RATE_TH=0.15;
  setAvoidance();
  Plane[] PL=new Plane[6];
  Point3d[] PN=new Point3d[6];
  Point3d handdir;
  int PNc=0;

  HV.self.toggleTrace();
  Mars.clearComets();
  
  setPlaneProperties();
/*
  for (int i=0;i<hpc;i++)
  {
    Plane pl=hplist[i];
    ///Mars.addComet(pl.CP,VA.add(pl.CP,VA.scale(pl.normal,150)),1);
  }
*/
  

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

  tIc=0;                  //  the joints that corresponds to target
  tIndex[tIc++]=ring[0]; //wrist;
  tIndex[tIc++]=thumb[2]; //thumbTip;

  Segment thumb_seg=hand.seg[thumbTip];
  Segment index_seg=hand.seg[index[2]];
  Segment wrist_seg=hand.seg[wrist];
  Point3d ORG=VA.add(root.limb_pos,root.joint_pos);
  VA._scale(ORG,0.5);
  Point3d AXE=root.joint_axis;


  Point3d opposition;      /// VA.subtract(ORG,hand.wristx.limb_pos);
  if (ORG.x<0) opposition=new Point3d(1,1.13,0);
  else opposition=new Point3d(0,1.13,-1);
  VA._normalize(opposition);

  PNc=lineIntersection(ORG, opposition, PL, PN);
  VA._resize(PN[0],PN[1],1.4);
  ///Mars.addComet(PN[0],PN[1],4);

  Point3d tempRi=null;
  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);
  System.out.println(" middle Intersection:"+tempRi.str());
//-----
  if (ORG.x<0) opposition=new Point3d(0,0,-1);
  else opposition=new Point3d(-1,-1.13,0);
  VA._normalize(opposition);

  PNc=lineIntersection(ORG, opposition, PL, PN);
  VA._resize(PN[0],PN[1],1.4);
  ///Mars.addComet(PN[0],PN[1],7);

  Point3d tempT=null;
  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);
  System.out.println(" thumb Intersection:"+tempT.str());



  int pnc=0;
  PN[pnc++]=tempRi;   //new Point3d(  20, 20,0); 
  PN[pnc++]=tempT;   //new Point3d(  20, 20,0); 

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

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

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

  //Mars.addComet(target[0],target[1],10);
  objsize=estimateSize();
  HV.self.toggleTrace();
  HV.cv.refreshDisplay();
 }