示例#1
0
def test_if_nurbs_python_is_reliable():
    # Testing for some known values, just for the case
    # that NURBS-Python is incorrect.
    expected = [(0.0, 0.0, 0.0),
                (11.840000000000003, 13.760000000000002, 16.64),
                (22.72, 14.079999999999998, 22.719999999999995),
                (31.759999999999994, 11.2, 24.399999999999995),
                (39.92, 7.999999999999999, 26.0), (50.0, 0.0, 30.0)]
    params = [0, .2, .4, .6, .8, 1.0]
    curve = BSpline(DEFPOINTS).to_nurbs_python_curve()
    points = curve.evaluate_list(params)
    for expect, point in zip(expected, points):
        assert Vec3(expect).isclose(point)
示例#2
0
 def test_point_calculation_is_correct(self, order, results):
     curve = BSpline(DEFPOINTS, order=order).to_nurbs_python_curve()
     points = curve.evaluate_list(PARAMS)
     for expect, point in zip(results, points):
         assert expect.isclose(point)