1. A computer-implemented method, comprising: obtaining a reference three-dimensional (3D) shape; receiving input specifying a constraint curve drawn on a surface of the reference 3D shape; automatically closing the constraint curve by connecting endpoints of the constraint curve with a line segment if the constraint curve is open; generating an N-sided patch from the specified constraint curve and the reference 3D shape, the generating comprising solving a linear system of equations constructed using one or more vertices that are not part of a mesh describing the reference 3D shape; and displaying the generated N-sided patch.