Mercurial > octave-nkf
comparison scripts/plot/__marching_cube__.m @ 10635:d1978e7364ad
Print name of function in error() string messages.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Sun, 16 May 2010 22:26:54 -0700 |
parents | 09da0bd91412 |
children | 693e22af08ae |
comparison
equal
deleted
inserted
replaced
10634:60542efcfa2c | 10635:d1978e7364ad |
---|---|
94 print_usage (); | 94 print_usage (); |
95 endif | 95 endif |
96 | 96 |
97 if (!ismatrix (xx) || !ismatrix (yy) || !ismatrix (zz) || !ismatrix (c) || ... | 97 if (!ismatrix (xx) || !ismatrix (yy) || !ismatrix (zz) || !ismatrix (c) || ... |
98 ndims (xx) != 3 || ndims (yy) != 3 || ndims (zz) != 3 || ndims (c) != 3) | 98 ndims (xx) != 3 || ndims (yy) != 3 || ndims (zz) != 3 || ndims (c) != 3) |
99 error ("xx, yy, zz, c have to be matrizes of dim 3"); | 99 error ("__marching_cube__: xx, yy, zz, c have to be matrizes of dim 3"); |
100 endif | 100 endif |
101 | 101 |
102 if (!size_equal (xx, yy, zz, c)) | 102 if (!size_equal (xx, yy, zz, c)) |
103 error ("xx, yy, zz, c are not the same size"); | 103 error ("__marching_cube__: xx, yy, zz, c are not the same size"); |
104 endif | 104 endif |
105 | 105 |
106 if (any (size (xx) < [2 2 2])) | 106 if (any (size (xx) < [2 2 2])) |
107 error ("grid size has to be at least 2x2x2"); | 107 error ("__marching_cube__: grid size has to be at least 2x2x2"); |
108 endif | 108 endif |
109 | 109 |
110 if (!isscalar (iso)) | 110 if (!isscalar (iso)) |
111 error ("iso needs to be scalar value"); | 111 error ("__marching_cube__: iso needs to be scalar value"); |
112 endif | 112 endif |
113 | 113 |
114 if (nargin == 6) | 114 if (nargin == 6) |
115 if ( !ismatrix (colors) || ndims (colors) != 3 || size (colors) != size (c) ) | 115 if ( !ismatrix (colors) || ndims (colors) != 3 || size (colors) != size (c) ) |
116 error ( "color has to be matrix of dim 3 and of same size as c" ); | 116 error ( "color has to be matrix of dim 3 and of same size as c" ); |
207 if (nargin == 9) | 207 if (nargin == 9) |
208 p = zeros (length (p1x), 3); | 208 p = zeros (length (p1x), 3); |
209 elseif (nargin == 11) | 209 elseif (nargin == 11) |
210 p = zeros (length (p1x), 4); | 210 p = zeros (length (p1x), 4); |
211 else | 211 else |
212 error ("Wrong number of arguments"); | 212 error ("__marching_cube__: wrong number of arguments"); |
213 endif | 213 endif |
214 mu = zeros (length (p1x), 1); | 214 mu = zeros (length (p1x), 1); |
215 id = abs (valp1-valp2) < (10*eps) .* (abs (valp1) .+ abs (valp2)); | 215 id = abs (valp1-valp2) < (10*eps) .* (abs (valp1) .+ abs (valp2)); |
216 if (any (id)) | 216 if (any (id)) |
217 p(id, 1:3) = [ p1x(id), p1y(id), p1z(id) ]; | 217 p(id, 1:3) = [ p1x(id), p1y(id), p1z(id) ]; |