]> Creatis software - CreaPhase.git/blob - octave_packages/nurbs-1.3.6/private/nrb_crv_basisfun__.m
Add a useful package (from Source forge) for octave
[CreaPhase.git] / octave_packages / nurbs-1.3.6 / private / nrb_crv_basisfun__.m
1   function [B, nbfu] = nrb_crv_basisfun__ (points, nrb);
2 %  __NRB_CRV_BASISFUN__: Undocumented internal function
3 %
4 %   Copyright (C) 2009 Carlo de Falco
5 %   This software comes with ABSOLUTELY NO WARRANTY; see the file
6 %   COPYING for details.  This is free software, and you are welcome
7 %   to distribute it under the conditions laid out in COPYING.
8     n    = size (nrb.coefs, 2) -1;
9     p    = nrb.order -1;
10     u    = points;
11     U    = nrb.knots;
12     w    = nrb.coefs(4,:);
13     
14     spu  =  findspan (n, p, u, U); 
15     nbfu =  numbasisfun (spu, u, p, U);
16     
17     N     = w(nbfu+1) .* basisfun (spu, u, p, U);
18     B     = bsxfun (@(x,y) x./y, N, sum (N,2));
19
20   end