docs: int addLineToGrid(SquareNode a, SquareNode b, List<SquareNode> list) {
  
  		int total = 2;
  //		double maxAngle = UtilAngle.radian(45);
  
  		while( true ) {
  //			double slopeX0 = b.center.x - a.center.x;
  //			double slopeY0 = b.center.y - a.center.y;
  
  //			double angleAB = Math.atan2(slopeY0,slopeX0);
  
  			// see which side the edge belongs to on b
  			boolean matched = false;
  			int side;
  			for( side = 0; side < 4; side++ ) {
  				if( b.edges[side] != null && b.edges[side].destination(b) == a ) {
  					matched = true;
  					break;
  				}
  			}
  
  			if(!matched) {
  				throw new RuntimeException("BUG!");
  			}
  
  			// must be on the adjacent side
  			side = (side+2)%4;
  
  			if( b.edges[side] == null )
  				break;
  
  			SquareNode c = b.edges[side].destination(b);
  
  			if (c.graph == SEARCHED )
  				break;
  
  //			double slopeX1 = c.center.x - b.center.x;
  //			double slopeY1 = c.center.y - b.center.y;
  //
  //			double angleBC = Math.atan2(slopeY1,slopeX1);
  //			double acute = Math.abs(UtilAngle.minus(angleAB,angleBC));
  
  //			if( acute >= maxAngle )
  //				break;
  
  			total++;
  			c.graph = SEARCHED;
  			list.add(c);
  			a = b;
  			b = c;
  		}
  		return total;
  	}