tataratat / splinepy

Library for prototyping spline geometries of arbitrary dimensions and degrees, and IGA
https://tataratat.github.io/splinepy
Other
45 stars 13 forks source link

Bezier Extraction issues #406

Closed jzwar closed 4 months ago

jzwar commented 5 months ago

Following test fails:

import splinepy as sp
import numpy as np

test = sp.BSpline(
    degrees=[0, 0],
    control_points=[
        [0], [1], [2], [3],
    ],
    knot_vectors=[[0, .5, 1], [0, .5, 1]]
)

for i, patch in enumerate(test.extract.beziers()):
    if not np.allclose(test.cps[i], patch.cps[0]):
        print(f"{i}")

2,3

@j042 , ideas?

jzwar commented 5 months ago

test.knot_insertion_matrix(beziers=True) -> Segfault

jzwar commented 5 months ago

Pretty sure the problem is in this line

Bezier extraction assumes C^0, but 0th order is C^-1

Is this something we want fixed, or just warning? Bezier could also be special case (as Bezier extraction just results in cps[i]

jzwar commented 5 months ago

Has been fixed for bezier extraction, however, there is still a bug in the bezier extraction matrices, pushed it to new issue #409

j042 commented 4 months ago

Thanks for the fix!