# HG changeset patch # User Rik # Date 1380150009 25200 # Node ID cd98a50bfa6350a8453893a6b4c57b195c52c870 # Parent 89ffc9c786e5f0446e2b1ab108ec3f060254f9cb hidden.m: Fix hidden so that it also works for trimesh objects. * scripts/plot/trimesh.m: Set "Tag" property of patch object to "trimesh". * scripts/plot/hidden.m: Search for surface objects or objects with Tag "trimesh". diff --git a/scripts/plot/hidden.m b/scripts/plot/hidden.m --- a/scripts/plot/hidden.m +++ b/scripts/plot/hidden.m @@ -52,7 +52,8 @@ for h = (get (gca (), "children")).'; htype = get (h, "type"); - if (strcmp (htype, "surface")) + htag = get (h, "tag"); + if (strcmp (htype, "surface") || strcmp (htag, "trimesh")) fc = get (h, "facecolor"); if ((! ischar (fc) && is_white (fc)) || (ischar (fc) && strcmp (fc, "none"))) diff --git a/scripts/plot/trimesh.m b/scripts/plot/trimesh.m --- a/scripts/plot/trimesh.m +++ b/scripts/plot/trimesh.m @@ -79,9 +79,10 @@ hax = newplot (); + ## Tag object as "trimesh" so that hidden() can find it. htmp = patch ("Vertices", [x(:), y(:), z(:)], "Faces", tri, "FaceVertexCdata", c, "EdgeColor", "flat", "FaceColor", "w", - varargin{:}); + "Tag", "trimesh", varargin{:}); if (! ishold ()) set (hax, "view", [-37.5, 30], "box", "off", "xgrid", "on", "ygrid", "on", "zgrid", "on");