Curve fitting and patch layout