[go: up one dir, main page]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Surface.const_par_curve gives unexpected results when working around an inner knot #168

Open
UnaiSan opened this issue Feb 1, 2024 · 0 comments

Comments

@UnaiSan
Copy link
UnaiSan commented Feb 1, 2024

I have seen the following unexpected (for me) behaviour in Surface.const_par_curve.

from splipy import Curve, BSplineBasis
from splipy.surface_factory import loft

bu = splipy.BSplineBasis(4)
crv1 = splipy.Curve(bu, [[0, 0, 0], [1, 0, 0], [1, 1, 0], [0, 1, 0]], raw=True)
crv2 = splipy.Curve(bu, [[0, 0, 3.5], [0.2, 0, 3.5], [0.2, 0.8, 3.5], [0, 0.7, 3.5]], raw=True)
crv3 = splipy.Curve(bu, [[0.2, -0.4, 5], [0.2, 1, 5], [0.6, 0.8, 5], [-0.5, 1.7, 5]], raw=True)
crv4 = splipy.Curve(bu, [[-0.2, 0.1, 7], [0.28, 1.5, 7], [0.1, -0.8, 7], [0.5, 1.0, 7]], raw=True)
srf = surface_factory.loft(crv1, crv2, crv3, crv4)
srf.bases[1].normalize()
srf.insert_knot(0.85, direction=1)

# srf.bases[1] is [0, 0, 0, 0, 0.85, 1, 1, 1, 1]

The calls to evaluate and const_par_curve give different results when we work around the inner knot 0.85

srf(0, 0.85 + 1e-10)
# array([ 0.14586581, -0.37665208,  5.93847258])
srf.const_par_curve(0.85 + 1e-10, direction=1)(0)
# array([ 0.08664116, -0.30658523,  6.28807807])

Those results should be the same, or at least very similar. The call to evaluate includes a call to snap the parameter, but in the const_par_curve this effect is not achieved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant