From: <raf...@us...> - 2012-07-17 13:00:21
|
Revision: 10748 http://octave.svn.sourceforge.net/octave/?rev=10748&view=rev Author: rafavzqz Date: 2012-07-17 13:00:15 +0000 (Tue, 17 Jul 2012) Log Message: ----------- Fixed bug in nrbplot. New version of nrbkntplot Modified Paths: -------------- trunk/octave-forge/extra/nurbs/inst/nrbkntplot.m trunk/octave-forge/extra/nurbs/inst/nrbplot.m Modified: trunk/octave-forge/extra/nurbs/inst/nrbkntplot.m =================================================================== --- trunk/octave-forge/extra/nurbs/inst/nrbkntplot.m 2012-07-17 11:30:00 UTC (rev 10747) +++ trunk/octave-forge/extra/nurbs/inst/nrbkntplot.m 2012-07-17 13:00:15 UTC (rev 10748) @@ -20,7 +20,7 @@ % % nrbctrlplot % -% Copyright (C) 2011 Rafael Vazquez +% Copyright (C) 2011, 2012 Rafael Vazquez % % This program is free software: you can redistribute it and/or modify % it under the terms of the GNU General Public License as published by @@ -80,46 +80,15 @@ elseif (size (nurbs.knots,2) == 3) % plot a NURBS volume - nsub = 30; - nrbplot (nurbs, [nsub nsub nsub], 'light', light, 'colormap', cmap); - hold on + nsub = 100; - % And plot the knots - knt1 = unique (nurbs.knots{1}); - knt2 = unique (nurbs.knots{2}); - knt3 = unique (nurbs.knots{3}); - kv_face1 = nrbeval (nurbs, {knt1(1), knt2, linspace(knt3(1),knt3(end),nsub)}); - kw_face1 = nrbeval (nurbs, {knt1(1), linspace(knt2(1),knt2(end),nsub), knt3}); - kv_face2 = nrbeval (nurbs, {knt1(end), knt2, linspace(knt3(1),knt3(end),nsub)}); - kw_face2 = nrbeval (nurbs, {knt1(end), linspace(knt2(1),knt2(end),nsub), knt3}); - ku_face3 = nrbeval (nurbs, {knt1, knt2(1), linspace(knt3(1),knt3(end),nsub)}); - kw_face3 = nrbeval (nurbs, {linspace(knt1(1),knt1(end),nsub), knt2(1), knt3}); - ku_face4 = nrbeval (nurbs, {knt1, knt2(end), linspace(knt3(1),knt3(end),nsub)}); - kw_face4 = nrbeval (nurbs, {linspace(knt1(1),knt1(end),nsub), knt2(end), knt3}); - ku_face5 = nrbeval (nurbs, {knt1, linspace(knt2(1),knt2(end),nsub), knt3(1)}); - kv_face5 = nrbeval (nurbs, {linspace(knt1(1),knt1(end),nsub), knt2, knt3(1)}); - ku_face6 = nrbeval (nurbs, {knt1, linspace(knt2(1),knt2(end),nsub), knt3(end)}); - kv_face6 = nrbeval (nurbs, {linspace(knt1(1),knt1(end),nsub), knt2, knt3(end)}); - - for ii = 1:numel(knt1) - plot3 (squeeze (ku_face3(1,ii,:,:)), squeeze (ku_face3(2,ii,:,:)), squeeze (ku_face3(3,ii,:,:))); - plot3 (squeeze (ku_face4(1,ii,:,:)), squeeze (ku_face4(2,ii,:,:)), squeeze (ku_face4(3,ii,:,:))); - plot3 (squeeze (ku_face5(1,ii,:,:)), squeeze (ku_face5(2,ii,:,:)), squeeze (ku_face5(3,ii,:,:))); - plot3 (squeeze (ku_face6(1,ii,:,:)), squeeze (ku_face6(2,ii,:,:)), squeeze (ku_face6(3,ii,:,:))); + % Plot the boundaries + bnd = nrbextract (nurbs); + nrbkntplot (bnd(1)); + hold on + for iface = 2:6 + nrbkntplot (bnd(iface)); end - for ii = 1:numel(knt2) - plot3 (squeeze (kv_face1(1,:,ii,:)), squeeze (kv_face1(2,:,ii,:)), squeeze (kv_face1(3,:,ii,:))); - plot3 (squeeze (kv_face2(1,:,ii,:)), squeeze (kv_face2(2,:,ii,:)), squeeze (kv_face2(3,:,ii,:))); - plot3 (squeeze (kv_face5(1,:,ii,:)), squeeze (kv_face5(2,:,ii,:)), squeeze (kv_face5(3,:,ii,:))); - plot3 (squeeze (kv_face6(1,:,ii,:)), squeeze (kv_face6(2,:,ii,:)), squeeze (kv_face6(3,:,ii,:))); - end - for ii = 1:numel(knt3) - plot3 (squeeze (kw_face1(1,:,:,ii)), squeeze(kw_face1(2,:,:,ii)), squeeze (kw_face1(3,:,:,ii))); - plot3 (squeeze (kw_face2(1,:,:,ii)), squeeze(kw_face2(2,:,:,ii)), squeeze (kw_face2(3,:,:,ii))); - plot3 (squeeze (kw_face3(1,:,:,ii)), squeeze(kw_face3(2,:,:,ii)), squeeze (kw_face3(3,:,:,ii))); - plot3 (squeeze (kw_face4(1,:,:,ii)), squeeze(kw_face4(2,:,:,ii)), squeeze (kw_face4(3,:,:,ii))); - end - end else % plot a NURBS curve nsub = 1000; Modified: trunk/octave-forge/extra/nurbs/inst/nrbplot.m =================================================================== --- trunk/octave-forge/extra/nurbs/inst/nrbplot.m 2012-07-17 11:30:00 UTC (rev 10747) +++ trunk/octave-forge/extra/nurbs/inst/nrbplot.m 2012-07-17 13:00:15 UTC (rev 10748) @@ -32,6 +32,7 @@ % % Copyright (C) 2000 Mark Spink % Copyright (C) 2010 Carlo de Falco, Rafael Vazquez +% Copyright (C) 2012 Rafael Vazquez % % This program is free software: you can redistribute it and/or modify % it under the terms of the GNU General Public License as published by @@ -109,13 +110,13 @@ elseif (size (nurbs.knots,2) == 3) % plot the boundaries of a NURBS volume bnd = nrbextract (nurbs); hold_flag = ishold; - nrbplot (bnd(1), subd(2:3)); + nrbplot (bnd(1), subd(2:3), varargin{:}); hold on - nrbplot (bnd(2), subd(2:3)); - nrbplot (bnd(3), subd([1 3])); - nrbplot (bnd(4), subd([1 3])); - nrbplot (bnd(5), subd(1:2)); - nrbplot (bnd(6), subd(1:2)); + nrbplot (bnd(2), subd(2:3), varargin{:}); + nrbplot (bnd(3), subd([1 3]), varargin{:}); + nrbplot (bnd(4), subd([1 3]), varargin{:}); + nrbplot (bnd(5), subd(1:2), varargin{:}); + nrbplot (bnd(6), subd(1:2), varargin{:}); if (~hold_flag) hold off This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |