def test_g1_continuity_for_bezier_curves(): assert have_bezier_curves_g1_continuity(B1, B2) is True assert have_bezier_curves_g1_continuity(B1, B3) is False assert (have_bezier_curves_g1_continuity(B1, B4, g1_tol=1e-4) is False), "should be outside of tolerance " assert (have_bezier_curves_g1_continuity(B1, B5) is False), "end- and start point should match"
def to_bspline(): b1 = bezier[0] _g1_continuity_curves = [b1] for b2 in bezier[1:]: if have_bezier_curves_g1_continuity(b1, b2, g1_tol): _g1_continuity_curves.append(b2) else: yield bezier_to_bspline(_g1_continuity_curves) _g1_continuity_curves = [b2] b1 = b2 if _g1_continuity_curves: yield bezier_to_bspline(_g1_continuity_curves)
def test_g1_continuity_for_degenerated_bezier_curves(): assert have_bezier_curves_g1_continuity(D1, B2) is False assert have_bezier_curves_g1_continuity(B1, D2) is False assert have_bezier_curves_g1_continuity(D1, D2) is False