docs: public ConstraintNetwork refineTrajectoryEnvelopes() {
  		ConstraintNetwork ret = new ConstraintNetwork(null);
  		
  		boolean done = false;
  		while (!done) {
  			done = true;
  			Variable[] varsOneIteration = this.getConstraintSolvers()[0].getVariables();
  			for (int i = 0; i < varsOneIteration.length-1; i++) {
  				for (int j = i+1; j < varsOneIteration.length; j++) {
  
  					//Get TEs
  					TrajectoryEnvelope te1 = (TrajectoryEnvelope)varsOneIteration[i];
  					TrajectoryEnvelope te2 = (TrajectoryEnvelope)varsOneIteration[j];
  
  					//Init data structures
  					if (!refinedWith.containsKey(te1)) refinedWith.put(te1,new ArrayList<TrajectoryEnvelope>());
  					if (!refinedWith.containsKey(te2)) refinedWith.put(te2,new ArrayList<TrajectoryEnvelope>());
  
  					// If != robots
  					boolean te1HasSub = te1.hasSubEnvelopes();
  					boolean te2HasSub = te2.hasSubEnvelopes();
  					if (te1.getRobotID() != te2.getRobotID()) {
  						//if they intersect
  						GeometricShapeVariable poly1 = te1.getEnvelopeVariable();
  						GeometricShapeVariable poly2 = te2.getEnvelopeVariable();
  						Geometry shape1 = ((GeometricShapeDomain)poly1.getDomain()).getGeometry();
  						Geometry shape2 = ((GeometricShapeDomain)poly2.getDomain()).getGeometry();
  						if (shape1.intersects(shape2)) {
  //							logger.info("===>Refinement 1: " + (!te2HasSub && te1.getRefinable() && !refinedWith.get(te1).contains(te2))+
  //									" Refinement 2: "+(!te1HasSub && te2.getRefinable() && !refinedWith.get(te2).contains(te1)));
  							if (!te2HasSub && te1.getRefinable() && !refinedWith.get(te1).contains(te2)) {
  								ConstraintNetwork ref1 = refineTrajectoryEnvelopes(te1, te2);
  								refinedWith.get(te1).add(te2);
  								ret.join(ref1);
  								done = false;
  							}
  							if (!te1HasSub && te2.getRefinable() && !refinedWith.get(te2).contains(te1)) {
  								ConstraintNetwork ref2 = refineTrajectoryEnvelopes(te2, te1);
  								refinedWith.get(te2).add(te1);
  								ret.join(ref2);
  								done = false;
  							}
  						}
  					}
  					//we have refined (i,j) with each other
  //					logger.info("Refined " + te1 + " into " + te1.getGroundEnvelopes().size() + " envelopes");
  //					logger.info("Refined " + te2 + " into " + te2.getGroundEnvelopes().size() + " envelopes");
  				}
  			}			
  		}
  		recomputeUsages();
  		return ret;
  	}