comparison scripts/plot/draw/tetramesh.m @ 19164:ba167badef9f

Deprecate delaunay3 and extend delaunay to 3-D inputs. * NEWS: Announce deprecation of delaunay3. Announce extension of delaunay to 3-D inputs. * scripts/deprecated/delaunay3.m: Moved from geometry/. Print warning about deprecation when executing function for the first time. * scripts/deprecated/module.mk: Add deprecated delaunay3.m to build system. * scripts/geometry/module.mk: Remove from geometry directory build system * delaunay.m: Redo docstring to mention 2-D and 3-D inputs. Overhaul function to accept 3-D inputs. Add %!error input validation tests. * delaunayn, tetramesh.m: Remove seealso reference to delaunay3. * geometry.txi, install.txi: Remove delaunay3 from manual.
author Rik <rik@octave.org>
date Fri, 26 Sep 2014 09:02:53 -0700
parents d63878346099
children 0e1f5a750d00
comparison
equal deleted inserted replaced
19163:71da5cce37d6 19164:ba167badef9f
41 ## handle represents one tetrahedron in the order given by @var{T}. 41 ## handle represents one tetrahedron in the order given by @var{T}.
42 ## A typical use case for @var{h} is to turn the respective patch 42 ## A typical use case for @var{h} is to turn the respective patch
43 ## @qcode{"visible"} property @qcode{"on"} or @qcode{"off"}. 43 ## @qcode{"visible"} property @qcode{"on"} or @qcode{"off"}.
44 ## 44 ##
45 ## Type @code{demo tetramesh} to see examples on using @code{tetramesh}. 45 ## Type @code{demo tetramesh} to see examples on using @code{tetramesh}.
46 ## @seealso{trimesh, delaunay3, delaunayn, patch} 46 ## @seealso{trimesh, delaunay, delaunayn, patch}
47 ## @end deftypefn 47 ## @end deftypefn
48 48
49 ## Author: Martin Helm <martin@mhelm.de> 49 ## Author: Martin Helm <martin@mhelm.de>
50 50
51 function h = tetramesh (varargin) 51 function h = tetramesh (varargin)
128 %! d = [-1 1]; 128 %! d = [-1 1];
129 %! [x,y,z] = meshgrid (d, d, d); 129 %! [x,y,z] = meshgrid (d, d, d);
130 %! x = [x(:); 0]; 130 %! x = [x(:); 0];
131 %! y = [y(:); 0]; 131 %! y = [y(:); 0];
132 %! z = [z(:); 0]; 132 %! z = [z(:); 0];
133 %! tetra = delaunay3 (x, y, z); 133 %! tetra = delaunay (x, y, z);
134 %! X = [x(:) y(:) z(:)]; 134 %! X = [x(:) y(:) z(:)];
135 %! colormap (jet (64)); 135 %! colormap (jet (64));
136 %! h = tetramesh (tetra, X); 136 %! h = tetramesh (tetra, X);
137 %! set (h(1:2:end), 'Visible', 'off'); 137 %! set (h(1:2:end), 'Visible', 'off');
138 %! axis equal; 138 %! axis equal;
145 %! d = [-1 1]; 145 %! d = [-1 1];
146 %! [x,y,z] = meshgrid (d, d, d); 146 %! [x,y,z] = meshgrid (d, d, d);
147 %! x = [x(:); 0]; 147 %! x = [x(:); 0];
148 %! y = [y(:); 0]; 148 %! y = [y(:); 0];
149 %! z = [z(:); 0]; 149 %! z = [z(:); 0];
150 %! tetra = delaunay3 (x, y, z); 150 %! tetra = delaunay (x, y, z);
151 %! X = [x(:) y(:) z(:)]; 151 %! X = [x(:) y(:) z(:)];
152 %! colormap (gray (256)); 152 %! colormap (gray (256));
153 %! tetramesh (tetra, X, 21:20:241, 'EdgeColor', 'w'); 153 %! tetramesh (tetra, X, 21:20:241, 'EdgeColor', 'w');
154 %! axis equal; 154 %! axis equal;
155 %! view (30, 20); 155 %! view (30, 20);