CLIPMESHVERTICES Clip vertices of a surfacic mesh and remove outer faces.

   [V2, F2] = clipMeshVertices(V, F, B)
   Clip a mesh represented by vertex array V and face array F, with the
   box represented by B. The result is the set of vertices contained in
   the box, and a new set of faces corresponding to original faces with
   all vertices within the box.
   
   [V2, F2] = clipMeshVertices(..., 'shape', 'sphere') Specify the shape.
   Default is 'box'. But it is also possible to use 'sphere' or 'plane'.
   
   [V2, F2] = clipMeshVertices(..., 'inside', false) removes the inner 
   faces instead of the outer faces.

   [V2, F2] = clipMeshVertices(..., 'trimMesh', TF)
   Also specifies if the isolated vertices need to be removed (TF=true) ot
   not (TF=false). Default is false.


   Example
     [v, f] = createSoccerBall;
     f = triangulateFaces(f);
     box = [0 2 -1 2 -.5 2];
     [v2, f2] = clipMeshVertices(v, f, box, 'inside', false);
     figure('color','w'); view(3); axis equal
     drawMesh(v, f, 'faceColor', 'none', 'faceAlpha', .2);
     drawBox3d(box)
     drawMesh(v2, f2, 'faceAlpha', .7);

   See also
   meshes3d, clipPoints3d

Package: matgeom