optimize trapezoid splitting