Reparameterize Geom_BSplineCurve and/or compute derivatives in homogeneous coordinates

I need to reparameterize a NURBS curve such that, for example, original parameters U = [0, 0.25, 0.5, 1.0] are mapped to new parameters S = [0, 0.2, 0.6, 1.0] (totally arbitrary, just for the sake of example).

If only the bounds need to be reparameterized, then BSplCLib::Reparametrize works just fine, but not for an arbitrary mapping.

The first question:

  • Does there exist a method in OCC to reparameterize a curve using a function? Perhaps BSplCLib::FunctionReparameterise does the trick, but I did not understand the documentation.

Since I was not able to find what I wanted, I just implemented a custom reparameterization using an arbitrary function following the details in the NURBS book. It works, and does exactly what I want, but as implemented only for non-rational BSpline curves. The reason for this is internally it relies on computing points/derivatives at parameter values as part of the algorithm to compute the new poles on the new knot vector. This process calls Geom_BSplineCurve.DN() to get derivates. In order for this to work on arbitrary NURBS curves, I need to compute the derivates in homogeneous coordinates in order to compute the new weights for the reparameterized curve. Which leads me to

The second question:

  • Is there a way to work in/compute derivatives in homogeneous coordinates where the poles would be denoted as P_i = {w_i*x_i, w_i*y_i, w_i*z_i, w_i}?