added support for both: opened and clamped b-splines