X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=octave_packages%2Fnurbs-1.3.6%2Fprivate%2Fnrb_srf_numbasisfun__.m;fp=octave_packages%2Fnurbs-1.3.6%2Fprivate%2Fnrb_srf_numbasisfun__.m;h=3dd0e8ba37b7c7283d0f402776ad02160c2e0795;hb=c880e8788dfc484bf23ce13fa2787f2c6bca4863;hp=0000000000000000000000000000000000000000;hpb=1705066eceaaea976f010f669ce8e972f3734b05;p=CreaPhase.git diff --git a/octave_packages/nurbs-1.3.6/private/nrb_srf_numbasisfun__.m b/octave_packages/nurbs-1.3.6/private/nrb_srf_numbasisfun__.m new file mode 100644 index 0000000..3dd0e8b --- /dev/null +++ b/octave_packages/nurbs-1.3.6/private/nrb_srf_numbasisfun__.m @@ -0,0 +1,34 @@ +function idx = nrb_srf_numbasisfun__ (points, nrb) + +% __NRB_SRF_NUMBASISFUN__: Undocumented internal function +% +% Copyright (C) 2009 Carlo de Falco +% This software comes with ABSOLUTELY NO WARRANTY; see the file +% COPYING for details. This is free software, and you are welcome +% to distribute it under the conditions laid out in COPYING. + + m = nrb.number(1)-1; + n = nrb.number(2)-1; + + npt = size(points,2); + u = points(1,:); + v = points(2,:); + + U = nrb.knots{1}; + V = nrb.knots{2}; + + p = nrb.order(1)-1; + q = nrb.order(2)-1; + + spu = findspan (m, p, u, U); + Ik = numbasisfun (spu, u, p, U); + + spv = findspan (n, q, v, V); + Jk = numbasisfun (spv, v, q, V); + + for k=1:npt + [Jkb, Ika] = meshgrid(Jk(k, :), Ik(k, :)); + idx(k, :) = sub2ind([m+1, n+1], Ika(:)+1, Jkb(:)+1); + end + +end