From: <raf...@us...> - 2012-09-05 08:41:26
|
Revision: 10963 http://octave.svn.sourceforge.net/octave/?rev=10963&view=rev Author: rafavzqz Date: 2012-09-05 08:41:17 +0000 (Wed, 05 Sep 2012) Log Message: ----------- Small changes Modified Paths: -------------- trunk/octave-forge/extra/nurbs/inst/nrbexport.m trunk/octave-forge/extra/nurbs/inst/nrbkntplot.m trunk/octave-forge/extra/nurbs/src/tbasisfun.cc Modified: trunk/octave-forge/extra/nurbs/inst/nrbexport.m =================================================================== --- trunk/octave-forge/extra/nurbs/inst/nrbexport.m 2012-09-04 21:29:27 UTC (rev 10962) +++ trunk/octave-forge/extra/nurbs/inst/nrbexport.m 2012-09-05 08:41:17 UTC (rev 10963) @@ -45,14 +45,14 @@ fprintf (fid, '%s\n', ['# ' date]); fprintf (fid, '%s\n', '#'); -fprintf (fid, '%2i', ndim, npatch); +fprintf (fid, '%4i', ndim, npatch); fprintf (fid, '\n'); for iptc = 1:npatch fprintf (fid, '%s %i', 'PATCH', iptc); fprintf (fid, '\n'); - fprintf (fid, '%2i', nurbs(iptc).order-1); + fprintf (fid, '%4i', nurbs(iptc).order-1); fprintf (fid, '\n'); - fprintf (fid, '%2i', nurbs(iptc).number); + fprintf (fid, '%4i', nurbs(iptc).number); fprintf (fid, '\n'); for ii = 1:ndim fprintf (fid, '%1.7f ', nurbs(iptc).knots{ii}); Modified: trunk/octave-forge/extra/nurbs/inst/nrbkntplot.m =================================================================== --- trunk/octave-forge/extra/nurbs/inst/nrbkntplot.m 2012-09-04 21:29:27 UTC (rev 10962) +++ trunk/octave-forge/extra/nurbs/inst/nrbkntplot.m 2012-09-05 08:41:17 UTC (rev 10963) @@ -80,8 +80,6 @@ elseif (size (nurbs.knots,2) == 3) % plot a NURBS volume - nsub = 100; - % Plot the boundaries bnd = nrbextract (nurbs); nrbkntplot (bnd(1)); Modified: trunk/octave-forge/extra/nurbs/src/tbasisfun.cc =================================================================== --- trunk/octave-forge/extra/nurbs/src/tbasisfun.cc 2012-09-04 21:29:27 UTC (rev 10962) +++ trunk/octave-forge/extra/nurbs/src/tbasisfun.cc 2012-09-05 08:41:17 UTC (rev 10963) @@ -93,33 +93,31 @@ void onebasisfunder__ (double u, octave_idx_type p, RowVector U, double *N, double *Nder) { double aux; - *N = 0.0; *Nder = 0.0; - if ((u <= U.min ()) || ( u > U.max ())) + *N = 0.0; *Nder = 0.0; + if ((u <= U.min ()) || ( u > U.max ())) return; - - else if (p == 0) - { - *N = 1.0; - *Nder = 0.0; + else if (p == 0) + { + *N = 1.0; + *Nder = 0.0; return; - } - - else { - - double ln = u - U(0); - double ld = U(U.length () - 2) - U(0); - - if (ld != 0) + } + else { + double ln = u - U(0); + double ld = U(U.length () - 2) - U(0); + + if (ld != 0) { onebasisfun__ (u, p-1, U.extract (0, U.length () - 2), &aux); - aux = aux / ld; - *N += ln * aux; - *Nder += p * aux; - } + aux = aux / ld; + *N += ln * aux; + *Nder += p * aux; + } - double dn = U(U.length () - 1) - u; - double dd = U(U.length () - 1) - U(1); - if (dd != 0) + double dn = U(U.length () - 1) - u; + double dd = U(U.length () - 1) - U(1); + + if (dd != 0) { onebasisfun__ (u, p-1, U.extract (1, U.length () - 1), &aux); aux = aux / dd; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |