comparison scripts/geometry/delaunayn.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 4318cb91deac
comparison
equal deleted inserted replaced
19163:71da5cce37d6 19164:ba167badef9f
45 ## If @var{options} is not present or @code{[]} then the default arguments are 45 ## If @var{options} is not present or @code{[]} then the default arguments are
46 ## used. Otherwise, @var{options} replaces the default argument list. 46 ## used. Otherwise, @var{options} replaces the default argument list.
47 ## To append user options to the defaults it is necessary to repeat the 47 ## To append user options to the defaults it is necessary to repeat the
48 ## default arguments in @var{options}. Use a null string to pass no arguments. 48 ## default arguments in @var{options}. Use a null string to pass no arguments.
49 ## 49 ##
50 ## @seealso{delaunay, delaunay3, convhulln, voronoin, trimesh, tetramesh} 50 ## @seealso{delaunay, convhulln, voronoin, trimesh, tetramesh}
51 ## @end deftypefn 51 ## @end deftypefn
52 52
53 function T = delaunayn (pts, varargin) 53 function T = delaunayn (pts, varargin)
54 54
55 if (nargin < 1) 55 if (nargin < 1)
73 ## the original simplex. If the relative volume is 1e3*eps then the simplex 73 ## the original simplex. If the relative volume is 1e3*eps then the simplex
74 ## is rejected. Note division of the two volumes means that the factor 74 ## is rejected. Note division of the two volumes means that the factor
75 ## prod(1:n) is dropped. 75 ## prod(1:n) is dropped.
76 idx = []; 76 idx = [];
77 [nt, n] = size (T); 77 [nt, n] = size (T);
78 ## FIXME: Vectorize this for loop or convert to delaunayn to .oct function 78 ## FIXME: Vectorize this for loop or convert delaunayn to .oct function
79 for i = 1:nt 79 for i = 1:nt
80 X = pts(T(i,1:end-1),:) - pts(T(i,2:end),:); 80 X = pts(T(i,1:end-1),:) - pts(T(i,2:end),:);
81 if (abs (det (X)) / sqrt (sum (X .^ 2, 2)) < 1e3 * myeps) 81 if (abs (det (X)) / sqrt (sum (X .^ 2, 2)) < 1e3 * myeps)
82 idx(end+1) = i; 82 idx(end+1) = i;
83 endif 83 endif