1 function pkl = surfderivcpts (n, p, U, m, q, V, P, d, r1, r2, s1, s2)
3 % SURFDERIVCPTS: Compute control points of n-th derivatives of a NURBS surface.
5 % usage: pkl = surfderivcpts (n, p, U, m, q, V, P, d)
9 % n+1, m+1 = number of control points
13 % d = derivative order
17 % pkl (k+1, l+1, i+1, j+1) = i,jth control point
18 % of the surface differentiated k
19 % times in the u direction and l
20 % times in the v direction
22 % Adaptation of algorithm A3.7 from the NURBS book, pg114
24 % Copyright (C) 2009 Carlo de Falco
26 % This program is free software: you can redistribute it and/or modify
27 % it under the terms of the GNU General Public License as published by
28 % the Free Software Foundation, either version 2 of the License, or
29 % (at your option) any later version.
31 % This program is distributed in the hope that it will be useful,
32 % but WITHOUT ANY WARRANTY; without even the implied warranty of
33 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 % GNU General Public License for more details.
36 % You should have received a copy of the GNU General Public License
37 % along with this program. If not, see <http://www.gnu.org/licenses/>.
46 du = min (d, p); dv = min (d, q);
49 temp = curvederivcpts (n, p, U, P(:,j+1:end), du, r1, r2);
52 pkl (k+1, 1, i+1, j-s1+1) = temp (k+1, i+1);
60 temp = curvederivcpts (m, q, V(s1+1:end), pkl(k+1, 1, i+1, :), ...
64 pkl (k+1, l+1, i+1, j+1) = temp (l+1, j+1);
73 %! coefs = cat(3,[0 0; 0 1],[1 1; 0 1]);
74 %! knots = {[0 0 1 1] [0 0 1 1]};
75 %! plane = nrbmak(coefs,knots);
76 %! pkl = surfderivcpts (plane.number(1)-1, plane.order(1)-1,...
77 %! plane.knots{1}, plane.number(2)-1,...
78 %! plane.order(2)-1, plane.knots{2}, ...
79 %! squeeze (plane.coefs(1,:,:)), 1);