changeset 28007:7cc9f35c2829

isosurface.m: Remove faces with NaN vertices (bug #57553).
author Markus Mützel <markus.muetzel@gmx.de>
date Sun, 26 Jan 2020 16:39:58 +0100
parents 91316b5dc5a2
children e6482c932d4b
files scripts/plot/draw/isosurface.m
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/plot/draw/isosurface.m	Sun Jan 26 14:17:00 2020 +0100
+++ b/scripts/plot/draw/isosurface.m	Sun Jan 26 16:39:58 2020 +0100
@@ -168,6 +168,12 @@
     warning ("isosurface: triangulation is empty");
   endif
 
+  # remove faces for which at least one of the vertices is NaN
+  vert_nan = 1:size (fvc.vertices, 1);
+  vert_nan(any (isnan (fvc.vertices), 2)) = NaN;
+  fvc.faces = vert_nan(fvc.faces);
+  fvc.faces(any (isnan (fvc.faces), 2), :) = [];
+
   if (! noshare)
     [fvc.faces, fvc.vertices, J] = __unite_shared_vertices__ (fvc.faces,
                                                               fvc.vertices);