I want to understand how to determine NURBS control points to fit some curve.

34 Views Asked by At

I've been trying to find the control points for a NURBS curve that I want to trace the first octant (1/8) of a unit circle using a second-degree rational bezier. I'm not entirely sure whether such is possible, but I have no reason to assume not, which is why I am trying anyways. I'm very confused and I believe I'm misunderstanding quite a bit; so I shall explain my confusion in hopes of gaining some understanding— However, the overarching question really is just how one would determine the correct control points.

To begin, I initially used the NURBS book, where it said

^"Clearly, from P1.16 and P1.17, P0 = (1,0), P1 = (1,1), and P2 = (0,1)."

where P1.16 and P1.17 were as follows:

"P 1.16: endpoint interpolation: C(0) = P0 and C(1) = Pn"

P 1. 17: the kth derivative at t = 0 (t = 1) depends on the first (last) k + 1 control points and weights; in particular, C' (0) and C' (1) are parallel to P1 - P0 and Pn - Pn-1, respectively;"

By checking for endpoint interpolation, we are essentially solving $\frac{(1-t)^2 P_0 + 2t(1-t) P_1 + 2t^2 P_2} {(1-t)^2 + 2t(1-t) + 2t^2} = P_0$ for when t = 0, and t = 1 respectively. I understand that P 1.16 then naturally holds, but I don't understand the relationship between this property and finding some specific endpoints.

Secondly, for 1.17, I'm quite sure that it is referring to the derivative of a NURBS curve. However, even after research, I am most confidently confusing something for I am not finding the correct derivative. Using Formula 11 from here (https://www.mn.uio.no/math/english/people/aca/michaelf/papers/bez.pdf), I computed the derivative to be this:

$\frac{ ((1-t)w_0 + tw_1) ((1-t)w_1 + tw_2) }{ ((1-t)^{2}w_0 + 2t(1-t)w_1 + t^{2}w_2)^{2} } \left( \frac{ ((1-t)w_1 P_1 + tw_2 P_2) }{ ((1-t)w_1 + tw_2) } - \frac{ ((1-t)w_0 P_0 + tw_1 P_1) }{ ((1-t)w_0 + tw_1) } \right)$

However, simply by graphing it, the curve seems to be incorrect. Also, would not the first derivative be undefined at t = 1, so how would find it? Furthermore, what does it mean for a curve (I imagine) to be parallel to some point?

I would appreciate some clarification on all these areas, however if in your assessment, that is beyond the scope of the question, then please explain how one would find the control points. Thanks.

1

There are 1 best solutions below

0
On BEST ANSWER

A rational quadratic Bézier curve has three control points, which I’ll call $P_0$, $P_a$, $P_1$. The point $P_0$ is the start-point of the curve, $P_1$ is the end-point, and $P_a$ is the apex point (i.e. the intersection point of the end tangents).

Also, each of the three control points has an associated weight. The weights at the start and end points can always be assumed to be $1$, so that leaves only the weight of the middle point, $P_a$, which I’ll denote by $w$. With these definitions, the equation of the curve is $$ P(t) = \frac{ (1-t)^2P_0 + 2t(1-t)wP_a + t^2P_1} {(1-t)^2+ 2t(1-t)w+ t^2} $$ To represent $1/8$ of a unit circle, we should set $P_0= (1,0)$ and $P_1= \tfrac12(\sqrt2, \sqrt2)$, obviously. The end tangents of our circular arc are the lines $x=1$ and $x+y = \sqrt2$. These intersect at the point $(1, \sqrt2-1)$, so this is our $P_a$. Now we only need to determine $w$. A fairly well-known fact is that $w=\cos\tfrac12\alpha$ for a circular arc whose angular span is $\alpha$. In our case $\alpha=\tfrac14\pi$, so $w=\cos\tfrac18\pi=\tfrac12\sqrt{2+\sqrt2} \approx 0.9239$.