Getting a subcurve from a parametric "segment" in a NURBS surface

177 Views Asked by At

Given a NURBS surface, how can I find the NURBS sub-curve that represents a specific parametric "segment" (ie a 2D segment defined in terms of uv parameters of the surface)?
I know there are ways to get the IsoSurface{U,V} at a specific parameter but I need a more generic method.
Alternatively, is there a way to transform a parametric NURBS curve (like the ones used in trimming) to its "standalone" 3D NURBS curve?

This is what I mean in practice:

example

Thank you.

2

There are 2 best solutions below

1
On BEST ANSWER

Let’s begin by talking about (polynomial) Bézier geometry, to make the explanations simpler. Extension to rational functions and b-splines (i.e. to NURBS geometry) is not trivial, but let’s walk before we run.

Suppose we have a Bézier surface $S(u,v)$, and a parameter space curve $u = u(t)$, $v=v(t)$ defined on our surface. The equation of the corresponding standalone 3D curve is simply $C(t) = S(u(t),v(t))$.

The curve $C$ is clearly a polynomial. In fact, if $S$ has degrees $m \times n$, $u$ has degree $p$, and $v$ has degree $q$, then $C$ has degree $mp+nq$. In your case, it seems that maybe $p=q=1$, though this is not entirely clear. This simplification doesn’t help much, but see my other answer.

So, how do we get the 3D control points of the curve $C$. There are several different ways:

  1. Convert $S, u,v$ to polynomial (power basis) form. Then the composition $C(t) = S(u(t),v(t))$ is easier to construct. The answer will again be in polynomial form, but you can convert it to Bézier form if you want.

  2. Compute $mp+nq+1$ points on the curve $C$, at equally-spaced values of $t$ using the formula $C(t) = S(u(t),v(t))$. Compute the (unique) Bézier curve that interpolates these points.

  3. Write (or find) some tools for doing composition of functions expressed in Bernstein-Bezier form.

I’d recommend #2. If you already have (or can find) a Bézier curve interpolation function, then it’s easy. More info here.

If you need to do this with polynomial b-spline surfaces, I’d recommend that you do it one Bézier patch at a time, and then glue the resulting curves together.

If you need to support rational b-spline geometry (i.e. NURBS), then the rational functions will cause numerous complications, as they often do.

0
On

Another approach ...

This assumes that you're working with a linear segment in parameter space, i.e. the case $p=q=1$.

Suppose you want the control points of the segment running between $(u_0,v_0)$ and $(u_1,v_1$. First, you trim the patch, so that the points $(u_0,v_0)$ and $(u_1,v_1)$ become its corners. The curve you want is the diagonal of this trimmed patch.

Using any of the techniques described in the other answer, you can construct closed-form formulas that give the control points of the diagonal of any Bezier patch of a given degree. For example, on a polynomial biquadratic patch (degree $2 {\times} 2$) with control points $P_{ij}$, you can show that the diagonal is a curve of degree 4 whose five control points are: \begin{align*} Q_0 &= P_{00} \\ Q_1 &= \tfrac12 (P_{01} + P_{10}) \\ Q_2 &= \tfrac16 (P_{02} + 4 P_{11} + P_{20}) \\ Q_3 &= \tfrac12 (P_{12} + P_{21}) \\ Q_4 &= P_{22} \end{align*}