def test_bspline_point_calculation_against_derivative_calculation(): # point calculation and derivative calculation are not the same functions # for optimization reasons. The derivatives() function returns the curve # point and n derivatives, check if both functions return the # same curve point: spline = BSpline(DEFPOINTS, order=4) curve_points = [p[0] for p in spline.derivatives(PARAMS, n=1)] for p, expected in zip(curve_points, spline.points(PARAMS)): assert p.isclose(expected)
def test_bspline_point_calculation_to_pre_calculated_results(order, results): spline = BSpline(DEFPOINTS, order=order) for p, expected in zip(spline.points(PARAMS), results): assert p.isclose(expected)