Change a curve weight
Start with the original three-control quadratic curve in Evaluate your first NURBS curve. At , its position is . The third control point is at .
Insert these lines immediately before the tutorial's point = curve%cmp_Xg(0.5_rk) line.
call curve%modify_Wc(W=2.0_rk, num=3)
if (.not. curve%err%ok) error stop "Could not change weight 3"
Run fpm run --profile release again. The program now prints 1.200 0.800. Increasing the third weight pulls the evaluated point toward that control point. Indices start at one, and the new weight must be finite and positive.
The curve API also accepts a complete weight vector. If your program exports cached samples, call create() to refresh a previously sampled grid after the edit.
Studio equivalent. Change a control-point weight in Patch → Points + weights.