A spilt-and-merge technique for building shaping