Constructing a diffeomorphism between a trimmed domain and the unit square