# HG changeset patch # User rafavzqz # Date 1426068392 0 # Node ID 560f9cfb5db9db89441106fc98b692914c168192 # Parent 1d0ab462926e6f8fed28e3522f94617ab3c11435 Consistent output in the univariate case diff -r 1d0ab462926e -r 560f9cfb5db9 extra/nurbs/inst/nrbdeval.m --- a/extra/nurbs/inst/nrbdeval.m Tue Mar 10 20:58:29 2015 +0000 +++ b/extra/nurbs/inst/nrbdeval.m Wed Mar 11 10:06:32 2015 +0000 @@ -166,14 +166,20 @@ [cup,cuw] = nrbeval (dnurbs,tt); temp1 = cuw(ones(3,1),:); jac = (cup-temp1.*pnt)./temp; + if (iscell (tt)) + jac = {jac}; + end % second derivative if (nargout == 3 && exist ('dnurbs2')) [cuup,cuuw] = nrbeval (dnurbs2, tt); temp2 = cuuw(ones(3,1),:); hess = (cuup - (2*cup.*temp1 + cp.*temp2)./temp + 2*cp.*temp1.^2./temp.^2)./temp; + if (iscell (tt)) + hess = {hess}; + end end - + end varargout{1} = pnt; diff -r 1d0ab462926e -r 560f9cfb5db9 extra/nurbs/inst/nrbeval.m --- a/extra/nurbs/inst/nrbeval.m Tue Mar 10 20:58:29 2015 +0000 +++ b/extra/nurbs/inst/nrbeval.m Wed Mar 11 10:06:32 2015 +0000 @@ -247,6 +247,10 @@ %% NURBS structure represents a curve %% tt represent a vector of parametric points in the u direction + if (iscell (tt) && numel (tt) == 1) + tt = cell2mat (tt); + end + st = size (tt); val = bspeval(nurbs.order-1,nurbs.coefs,nurbs.knots,tt(:)');