annotate scripts/plot/draw/isosurface.m @ 19734:00e31f316a3a

Fix Matlab incompatibility of "ismatrix" (bug #42422). * data.cc (isvector): new tests * data.cc (isrow): documentation improved, new tests * data.cc (iscolumn): documentation improved, new tests * data.cc (ismatrix): is matrix now only checks the dimension due to Matlab compatibility, documentation improved, new tests * accumarray.m: use more appropriate function, than ismatrix * gradient.m: use more appropriate function, than ismatrix * num2str.m: use more appropriate functions, than ismatrix * ntsc2rgb.m: use more appropriate function, than ismatrix * condest.m: use more appropriate function, than ismatrix * expm.m: use more appropriate function, than ismatrix * onenormest.m: use more appropriate function, than ismatrix * isocolors.m: use more appropriate function, than ismatrix * isonormals.m: use more appropriate function, than ismatrix * isosurface.m: use more appropriate function, than ismatrix * __errcomm__.m: use more appropriate function, than ismatrix * __interp_cube__.m: use more appropriate function, than ismatrix * __marching_cube__.m: use more appropriate function, than ismatrix * __stem__.m: use more appropriate function, than ismatrix * stairs.m: use more appropriate function, than ismatrix * validsetargs.m: use more appropriate functions, than ismatrix * unique.m: use more appropriate functions, than ismatrix * bicg.m: additional tests for numerical value * bicgstab.m: additional tests for numerical value * cgs.m: additional tests for numerical value * gmres.m: additional tests for numerical value * qmr.m: additional tests for numerical value
author Kai T. Ohlhus <k.ohlhus@gmail.com>
date Thu, 12 Feb 2015 18:34:56 +0100
parents 4197fc428c7d
children 9fc020886ae9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
19731
4197fc428c7d maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents: 17744
diff changeset
1 ## Copyright (C) 2009-2015 Martin Helm
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
2 ##
11104
2c356a35d7f5 fix copyright notices
John W. Eaton <jwe@octave.org>
parents: 10846
diff changeset
3 ## This file is part of Octave.
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
4 ##
11104
2c356a35d7f5 fix copyright notices
John W. Eaton <jwe@octave.org>
parents: 10846
diff changeset
5 ## Octave is free software; you can redistribute it and/or modify it
2c356a35d7f5 fix copyright notices
John W. Eaton <jwe@octave.org>
parents: 10846
diff changeset
6 ## under the terms of the GNU General Public License as published by
2c356a35d7f5 fix copyright notices
John W. Eaton <jwe@octave.org>
parents: 10846
diff changeset
7 ## the Free Software Foundation; either version 3 of the License, or (at
2c356a35d7f5 fix copyright notices
John W. Eaton <jwe@octave.org>
parents: 10846
diff changeset
8 ## your option) any later version.
2c356a35d7f5 fix copyright notices
John W. Eaton <jwe@octave.org>
parents: 10846
diff changeset
9 ##
2c356a35d7f5 fix copyright notices
John W. Eaton <jwe@octave.org>
parents: 10846
diff changeset
10 ## Octave is distributed in the hope that it will be useful, but
2c356a35d7f5 fix copyright notices
John W. Eaton <jwe@octave.org>
parents: 10846
diff changeset
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
2c356a35d7f5 fix copyright notices
John W. Eaton <jwe@octave.org>
parents: 10846
diff changeset
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2c356a35d7f5 fix copyright notices
John W. Eaton <jwe@octave.org>
parents: 10846
diff changeset
13 ## General Public License for more details.
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
14 ##
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
15 ## You should have received a copy of the GNU General Public License
11104
2c356a35d7f5 fix copyright notices
John W. Eaton <jwe@octave.org>
parents: 10846
diff changeset
16 ## along with Octave; see the file COPYING. If not, see
2c356a35d7f5 fix copyright notices
John W. Eaton <jwe@octave.org>
parents: 10846
diff changeset
17 ## <http://www.gnu.org/licenses/>.
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
18
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
19 ## -*- texinfo -*-
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
20 ## @deftypefn {Function File} {[@var{fv}] =} isosurface (@var{val}, @var{iso})
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
21 ## @deftypefnx {Function File} {[@var{fv}] =} isosurface (@var{x}, @var{y}, @var{z}, @var{val}, @var{iso})
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
22 ## @deftypefnx {Function File} {[@var{fv}] =} isosurface (@dots{}, "noshare", "verbose")
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
23 ## @deftypefnx {Function File} {[@var{fvc}] =} isosurface (@dots{}, @var{col})
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
24 ## @deftypefnx {Function File} {[@var{f}, @var{v}] =} isosurface (@var{x}, @var{y}, @var{z}, @var{val}, @var{iso})
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
25 ## @deftypefnx {Function File} {[@var{f}, @var{v}, @var{c}] =} isosurface (@var{x}, @var{y}, @var{z}, @var{val}, @var{iso}, @var{col})
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
26 ## @deftypefnx {Function File} {} isosurface (@var{x}, @var{y}, @var{z}, @var{val}, @var{iso}, @var{col}, @var{opt})
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
27 ##
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
28 ## If called with one output argument and the first input argument
12529
0579a13f29a1 Add isocolors, isonormals, isosurface functions to documentation.
Rik <octave@nomad.inbox5.com>
parents: 11587
diff changeset
29 ## @var{val} is a three-dimensional array that contains the data of an
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
30 ## isosurface geometry and the second input argument @var{iso} keeps the
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
31 ## isovalue as a scalar value then return a structure array @var{fv}
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
32 ## that contains the fields @var{Faces} and @var{Vertices} at computed
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
33 ## points @command{[x, y, z] = meshgrid (1:l, 1:m, 1:n)}. The output
11587
c792872f8942 all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
34 ## argument @var{fv} can directly be taken as an input argument for the
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
35 ## @command{patch} function.
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
36 ##
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
37 ## If called with further input arguments @var{x}, @var{y} and @var{z}
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
38 ## which are three--dimensional arrays with the same size than @var{val}
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
39 ## then the volume data is taken at those given points.
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
40 ##
17281
bc924baa2c4e doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents: 17190
diff changeset
41 ## The string input argument @qcode{"noshare"} is only for compatibility and
9758
09da0bd91412 Periodic grammar check of Octave documentation files to ensure common format
Rik <rdrider0-list@yahoo.com>
parents: 9110
diff changeset
42 ## has no effect. If given the string input argument
17281
bc924baa2c4e doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents: 17190
diff changeset
43 ## @qcode{"verbose"} then print messages to the command line interface about the
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
44 ## current progress.
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
45 ##
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
46 ## If called with the input argument @var{col} which is a
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
47 ## three-dimensional array of the same size than @var{val} then take
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
48 ## those values for the interpolation of coloring the isosurface
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
49 ## geometry. Add the field @var{FaceVertexCData} to the structure
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
50 ## array @var{fv}.
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
51 ##
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
52 ## If called with two or three output arguments then return the
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
53 ## information about the faces @var{f}, vertices @var{v} and color data
16839
905329f73b4a isosurface.m: Correct typo in documentation.
Rik <rik@octave.org>
parents: 16828
diff changeset
54 ## @var{c} as separate arrays instead of a single structure array.
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
55 ##
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
56 ## If called with no output argument then directly process the
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
57 ## isosurface geometry with the @command{patch} command.
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
58 ##
10846
a4f482e66b65 Grammarcheck more of the documentation.
Rik <octave@nomad.inbox5.com>
parents: 10842
diff changeset
59 ## For example,
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
60 ##
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
61 ## @example
9758
09da0bd91412 Periodic grammar check of Octave documentation files to ensure common format
Rik <rdrider0-list@yahoo.com>
parents: 9110
diff changeset
62 ## @group
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
63 ## [x, y, z] = meshgrid (1:5, 1:5, 1:5);
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
64 ## val = rand (5, 5, 5);
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
65 ## isosurface (x, y, z, val, .5);
9758
09da0bd91412 Periodic grammar check of Octave documentation files to ensure common format
Rik <rdrider0-list@yahoo.com>
parents: 9110
diff changeset
66 ## @end group
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
67 ## @end example
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
68 ##
10846
a4f482e66b65 Grammarcheck more of the documentation.
Rik <octave@nomad.inbox5.com>
parents: 10842
diff changeset
69 ## @noindent
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
70 ## will directly draw a random isosurface geometry in a graphics window.
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
71 ## Another example for an isosurface geometry with different additional
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
72 ## coloring
13929
9cae456085c2 Grammarcheck of documentation before 3.6.0 release.
Rik <octave@nomad.inbox5.com>
parents: 12974
diff changeset
73 ## @c Set example in small font to prevent overfull line
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
74 ##
12974
6590446c2498 doc: Correct Texinfo overfull hbox instances.
Rik <octave@nomad.inbox5.com>
parents: 12529
diff changeset
75 ## @smallexample
6590446c2498 doc: Correct Texinfo overfull hbox instances.
Rik <octave@nomad.inbox5.com>
parents: 12529
diff changeset
76 ## N = 15; # Increase number of vertices in each direction
6590446c2498 doc: Correct Texinfo overfull hbox instances.
Rik <octave@nomad.inbox5.com>
parents: 12529
diff changeset
77 ## iso = .4; # Change isovalue to .1 to display a sphere
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
78 ## lin = linspace (0, 2, N);
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
79 ## [x, y, z] = meshgrid (lin, lin, lin);
11587
c792872f8942 all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
80 ## c = abs ((x-.5).^2 + (y-.5).^2 + (z-.5).^2);
12974
6590446c2498 doc: Correct Texinfo overfull hbox instances.
Rik <octave@nomad.inbox5.com>
parents: 12529
diff changeset
81 ## figure (); # Open another figure window
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
82 ##
14327
4d917a6a858b doc: Use Octave coding conventions in @example blocks of docstrings.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
83 ## subplot (2,2,1); view (-38, 20);
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
84 ## [f, v] = isosurface (x, y, z, c, iso);
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
85 ## p = patch ("Faces", f, "Vertices", v, "EdgeColor", "none");
14327
4d917a6a858b doc: Use Octave coding conventions in @example blocks of docstrings.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
86 ## set (gca, "PlotBoxAspectRatioMode", "manual", ...
12974
6590446c2498 doc: Correct Texinfo overfull hbox instances.
Rik <octave@nomad.inbox5.com>
parents: 12529
diff changeset
87 ## "PlotBoxAspectRatio", [1 1 1]);
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
88 ## # set (p, "FaceColor", "green", "FaceLighting", "phong");
12974
6590446c2498 doc: Correct Texinfo overfull hbox instances.
Rik <octave@nomad.inbox5.com>
parents: 12529
diff changeset
89 ## # light ("Position", [1 1 5]); # Available with the JHandles package
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
90 ##
14327
4d917a6a858b doc: Use Octave coding conventions in @example blocks of docstrings.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
91 ## subplot (2,2,2); view (-38, 20);
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
92 ## p = patch ("Faces", f, "Vertices", v, "EdgeColor", "blue");
14327
4d917a6a858b doc: Use Octave coding conventions in @example blocks of docstrings.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
93 ## set (gca, "PlotBoxAspectRatioMode", "manual", ...
12974
6590446c2498 doc: Correct Texinfo overfull hbox instances.
Rik <octave@nomad.inbox5.com>
parents: 12529
diff changeset
94 ## "PlotBoxAspectRatio", [1 1 1]);
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
95 ## # set (p, "FaceColor", "none", "FaceLighting", "phong");
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
96 ## # light ("Position", [1 1 5]);
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
97 ##
14327
4d917a6a858b doc: Use Octave coding conventions in @example blocks of docstrings.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
98 ## subplot (2,2,3); view (-38, 20);
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
99 ## [f, v, c] = isosurface (x, y, z, c, iso, y);
14327
4d917a6a858b doc: Use Octave coding conventions in @example blocks of docstrings.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
100 ## p = patch ("Faces", f, "Vertices", v, "FaceVertexCData", c, ...
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
101 ## "FaceColor", "interp", "EdgeColor", "none");
14327
4d917a6a858b doc: Use Octave coding conventions in @example blocks of docstrings.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
102 ## set (gca, "PlotBoxAspectRatioMode", "manual", ...
12974
6590446c2498 doc: Correct Texinfo overfull hbox instances.
Rik <octave@nomad.inbox5.com>
parents: 12529
diff changeset
103 ## "PlotBoxAspectRatio", [1 1 1]);
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
104 ## # set (p, "FaceLighting", "phong");
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
105 ## # light ("Position", [1 1 5]);
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
106 ##
14327
4d917a6a858b doc: Use Octave coding conventions in @example blocks of docstrings.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
107 ## subplot (2,2,4); view (-38, 20);
4d917a6a858b doc: Use Octave coding conventions in @example blocks of docstrings.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
108 ## p = patch ("Faces", f, "Vertices", v, "FaceVertexCData", c, ...
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
109 ## "FaceColor", "interp", "EdgeColor", "blue");
14327
4d917a6a858b doc: Use Octave coding conventions in @example blocks of docstrings.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
110 ## set (gca, "PlotBoxAspectRatioMode", "manual", ...
12974
6590446c2498 doc: Correct Texinfo overfull hbox instances.
Rik <octave@nomad.inbox5.com>
parents: 12529
diff changeset
111 ## "PlotBoxAspectRatio", [1 1 1]);
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
112 ## # set (p, "FaceLighting", "phong");
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
113 ## # light ("Position", [1 1 5]);
12974
6590446c2498 doc: Correct Texinfo overfull hbox instances.
Rik <octave@nomad.inbox5.com>
parents: 12529
diff changeset
114 ## @end smallexample
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
115 ##
12529
0579a13f29a1 Add isocolors, isonormals, isosurface functions to documentation.
Rik <octave@nomad.inbox5.com>
parents: 11587
diff changeset
116 ## @seealso{isonormals, isocolors}
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
117 ## @end deftypefn
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
118
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
119 ## Author: Martin Helm <martin@mhelm.de>
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
120
14868
5d3a684236b0 maint: Use Octave coding conventions for cuddling parentheses in scripts directory
Rik <octave@nomad.inbox5.com>
parents: 14846
diff changeset
121 function varargout = isosurface (varargin)
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
122
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
123 if (nargin < 2 || nargin > 8 || nargout > 3)
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
124 print_usage ();
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
125 endif
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
126
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
127 calc_colors = false;
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
128 f = v = c = [];
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
129 verbose = false;
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
130 noshare = false;
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
131 if (nargin >= 5)
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
132 x = varargin{1};
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
133 y = varargin{2};
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
134 z = varargin{3};
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
135 val = varargin{4};
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
136 iso = varargin{5};
19734
00e31f316a3a Fix Matlab incompatibility of "ismatrix" (bug #42422).
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 19731
diff changeset
137 if (nargin >= 6 && isnumeric (varargin{6}))
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
138 colors = varargin{6};
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
139 calc_colors = true;
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
140 endif
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
141 else
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
142 val = varargin{1};
10842
830e03dd844e isosurface.m: swap rows and columns of matrix in call to meshgrid
Martin Helm <martin@mhelm.de>
parents: 10549
diff changeset
143 [n2, n1, n3] = size (val);
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
144 [x, y, z] = meshgrid (1:n1, 1:n2, 1:n3);
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
145 iso = varargin{2};
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
146 if (nargin >= 3 && ismatrix (varargin{3}))
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
147 colors = varargin{3};
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
148 calc_colors = true;
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
149 endif
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
150 endif
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
151 if (calc_colors)
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
152 if (nargout == 2)
17078
18137205f57d isosurface.m: Update to new version of newplot().
Rik <rik@octave.org>
parents: 16839
diff changeset
153 warning ("isosurface: colors will be calculated, but no output argument to receive it.");
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
154 endif
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
155 [fvc.faces, fvc.vertices, fvc.facevertexcdata] = __marching_cube__ (x, y, z, val, iso, colors);
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
156 else
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
157 [fvc.faces, fvc.vertices] = __marching_cube__ (x, y, z, val, iso);
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
158 endif
11587
c792872f8942 all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
159
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
160 if (isempty (fvc.vertices) || isempty (fvc.faces))
17078
18137205f57d isosurface.m: Update to new version of newplot().
Rik <rik@octave.org>
parents: 16839
diff changeset
161 warning ("isosurface: triangulation is empty");
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
162 endif
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
163
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
164 switch (nargout)
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
165 case 0
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
166 ## plot the calculated surface
17078
18137205f57d isosurface.m: Update to new version of newplot().
Rik <rik@octave.org>
parents: 16839
diff changeset
167 hax = newplot ();
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
168 if (calc_colors)
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
169 pa = patch ("Faces", fvc.faces, "Vertices", fvc.vertices,
11587
c792872f8942 all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
170 "FaceVertexCData", fvc.facevertexcdata,
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10226
diff changeset
171 "FaceColor", "flat", "EdgeColor", "none");
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
172 else
11587
c792872f8942 all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
173 pa = patch ("Faces", fvc.faces, "Vertices", fvc.vertices,
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10226
diff changeset
174 "FaceColor", "g", "EdgeColor", "k");
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
175 endif
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
176 if (! ishold ())
17633
382aaf2d533a isosurface.m: Turn off plot box and grid for Matlab visual compatibility.
Rik <rik@octave.org>
parents: 17572
diff changeset
177 set (hax, "view", [-37.5, 30], "box", "off");
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
178 endif
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
179 case 1
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
180 varargout = {fvc};
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
181 case 2
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
182 varargout = {fvc.faces, fvc.vertices};
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
183 case 3
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
184 varargout = {fvc.faces, fvc.vertices, fvc.facevertexcdata};
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
185 otherwise
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
186 print_usage ();
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
187 endswitch
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
188
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
189 endfunction
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
190
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
191
14237
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
192 %!demo
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
193 %! clf;
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
194 %! [x,y,z] = meshgrid (-2:0.5:2, -2:0.5:2, -2:0.5:2);
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
195 %! v = x.^2 + y.^2 + z.^2;
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
196 %! isosurface (x, y, z, v, 1);
17633
382aaf2d533a isosurface.m: Turn off plot box and grid for Matlab visual compatibility.
Rik <rik@octave.org>
parents: 17572
diff changeset
197 %! axis equal;
17190
df4c4b7708a4 Add titles and clean-up plotting %!demos.
Rik <rik@octave.org>
parents: 17078
diff changeset
198 %! title ('isosurface of a sphere');
14237
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
199
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
200 %!shared x, y, z, val
16828
ddac88d32d6a Make demos in plot m-files compatible with Matlab for running comparison script.
Rik <rik@octave.org>
parents: 14868
diff changeset
201 %! [x, y, z] = meshgrid (0:1, 0:1, 0:1); # Points for single
ddac88d32d6a Make demos in plot m-files compatible with Matlab for running comparison script.
Rik <rik@octave.org>
parents: 14868
diff changeset
202 %! val = [0, 0; 0, 0]; # cube and a 3-D
ddac88d32d6a Make demos in plot m-files compatible with Matlab for running comparison script.
Rik <rik@octave.org>
parents: 14868
diff changeset
203 %! val(:,:,2) = [0, 0; 1, 0]; # array of values
17078
18137205f57d isosurface.m: Update to new version of newplot().
Rik <rik@octave.org>
parents: 16839
diff changeset
204
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
205 %!test
14363
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14335
diff changeset
206 %! fv = isosurface (x, y, z, val, 0.3);
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14335
diff changeset
207 %! assert (isfield (fv, "vertices"), true);
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14335
diff changeset
208 %! assert (isfield (fv, "faces"), true);
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14335
diff changeset
209 %! assert (size (fv.vertices), [3 3]);
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14335
diff changeset
210 %! assert (size (fv.faces), [1 3]);
17078
18137205f57d isosurface.m: Update to new version of newplot().
Rik <rik@octave.org>
parents: 16839
diff changeset
211
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
212 %!test
14363
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14335
diff changeset
213 %! fvc = isosurface (x, y, z, val, .3, y);
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14335
diff changeset
214 %! assert (isfield (fvc, "vertices"), true);
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14335
diff changeset
215 %! assert (isfield (fvc, "faces"), true);
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14335
diff changeset
216 %! assert (isfield (fvc, "facevertexcdata"), true);
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14335
diff changeset
217 %! assert (size (fvc.vertices), [3 3]);
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14335
diff changeset
218 %! assert (size (fvc.faces), [1 3]);
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14335
diff changeset
219 %! assert (size (fvc.facevertexcdata), [3 1]);
17078
18137205f57d isosurface.m: Update to new version of newplot().
Rik <rik@octave.org>
parents: 16839
diff changeset
220
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
221 %!test
14363
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14335
diff changeset
222 %! [f, v] = isosurface (x, y, z, val, .3);
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14335
diff changeset
223 %! assert (size (f), [1 3]);
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14335
diff changeset
224 %! assert (size (v), [3 3]);
17078
18137205f57d isosurface.m: Update to new version of newplot().
Rik <rik@octave.org>
parents: 16839
diff changeset
225
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
226 %!test
14363
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14335
diff changeset
227 %! [f, v, c] = isosurface (x, y, z, val, .3, y);
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14335
diff changeset
228 %! assert (size (f), [1 3]);
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14335
diff changeset
229 %! assert (size (v), [3 3]);
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14335
diff changeset
230 %! assert (size (c), [3 1]);
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
diff changeset
231