Closed VikingScientist closed 3 years ago
from splipy import BSplineBasis, Curve from splipy.state import state import numpy as np b1 = BSplineBasis(order=4, knots=[0,0,0,0, 0.33333333333333326, 0.33333333333333326, 0.33333333333333326, 1,1,1,1]) b2 = BSplineBasis(order=4, knots=[0,0,0,0, 0.3333333333333333 , 0.3333333333333333 , 0.3333333333333333 , 1,1,1,1]) crv1 = Curve(b1, np.random.random((7,2))) crv2 = Curve(b2, np.random.random((7,2))) print('============= BEFORE ==================') print(crv1.knots(0,True)) print(crv2.knots(0,True)) Curve.make_splines_identical(crv1,crv2) print('============= AFTER ==================') print(crv1.knots(0,True)) print(crv2.knots(0,True))
Gives output:
============= BEFORE ================== [0. 0. 0. 0. 0.33333333 0.33333333 0.33333333 1. 1. 1. 1. ] [0. 0. 0. 0. 0.33333333 0.33333333 0.33333333 1. 1. 1. 1. ] ============= AFTER ================== [0. 0. 0. 0. 0.33333333 0.33333333 0.33333333 0.33333333 0.33333333 1. 1. 1. 1. ] [0. 0. 0. 0. 0.33333333 0.33333333 0.33333333 1. 1. 1. 1. ]
Notice that the first curve have the knot 1/3 duplicated 5 times.
Pretty sure that the error lies in BSplineBasis.continuity()
BSplineBasis.continuity()
Gives output:
Notice that the first curve have the knot 1/3 duplicated 5 times.