Directions guessDirection(int fromIndex, int toIndex) {
        int fromCell;
        if (fromIndex >= 0) {
            fromCell = cellIds.get(fromIndex);
        } else {
            fromCell = -1;
        }
        int toCell;
        if (toIndex >= 0) {
            toCell = cellIds.get(toIndex);
        } else {
            toCell = -1;
        }
        if ((fromCell >= 0) && (toCell >= 0)) {
            Vector<Integer> path = mesh.proposePath(fromCell, toCell);
            if (path.size() == 0) {
                return Directions.none;
            }
            int first = path.get(1);
            for (Directions dir : Directions.values()) {
                if (mesh.getNeighbor(fromCell, dir) == first) {
                    return dir;
                }
            }
        }
        Directions dir = guessDirectionIgnoringRotation(fromIndex, toIndex);
        int rotation = guessRotationInDegrees(fromIndex);
        return dir.rotate(rotation);
    }