# doc-cache created by Octave 5.1.0
# name: cache
# type: cell
# rows: 3
# columns: 59
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 9
boxToMesh


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 826
 BOXTOMESH Convert a box into a quad mesh with the same size

   [V E F] = boxToMesh(BOX) 
   Create a box as a polyhedra representation. The box is defined by its  
   coordinate extents: BOX = [XMIN XMAX YMIN YMAX ZMIN ZMAX] 
   The result has the form [V E F], where V is a 8-by-3 array with vertex
   coordinates, E is a 12-by-2 array containing indices of neighbour
   vertices, and F is a 6-by-4 array containing vertices array of each
   face.

   [V F] = boxToMesh(BOX)
   Returns only the vertices and the face vertex indices.

   MESH = boxToMesh(BOX)
   Returns the data as a mesh structure, with fields 'vertices', 'edges'
   and 'faces'.
   
   ... = boxToMesh()
   Creates a unit cube

   Example
   [v, f] = boxToMesh([-2 -1 0 pi 2 3])
   drawMesh(v, f);
   
   See also
   meshes3d, drawMesh, triangulateFaces



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 60
 BOXTOMESH Convert a box into a quad mesh with the same size



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
checkMeshAdjacentFaces


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 878
CHECKMESHADJACENTFACES Check if adjacent faces of a mesh have similar orientation

   checkMeshAdjacentFaces(VERTICES, EDGES, FACES)
   The functions returns no output, but if two faces share a common edge
   with the same direction (meaning that adjacent faces have normals in
   opposite direction), a warning is displayed. 
   
   Example
   [v e f] = createCube();
   checkMeshAdjacentFaces(v, e, f);
   % no output -> all faces have normal outwards of the cube

   v = [0 0 0; 10 0 0; 0 10 0; 10 10 0];
   e = [1 2;1 3;2 3;2 4;3 4];
   f = [1 2 3; 2 3 4];
   checkMeshAdjacentFaces(v, e, f);
      Warning: Faces 1 and 2 run through the edge 3 (2-3) in the same direction

   See also
   meshes3d

 ------
 Author: David Legland
 e-mail: david.legland@grignon.inra.fr
 Created: 2010-10-06,    using Matlab 7.9.0.529 (R2009b)
 Copyright 2010 INRA - Cepia Software Platform.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
CHECKMESHADJACENTFACES Check if adjacent faces of a mesh have similar orienta...



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
clipConvexPolyhedronHP


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 561
CLIPCONVEXPOLYHEDRONHP Clip a convex polyhedron by a plane

   [NODES2, FACES2] = clipConvexPolyhedronHP(NODES, FACES, PLANE)

   return the new (convex) polyhedron whose vertices are 'below' the
   specified plane, and with faces clipped accordingly. NODES2 contains
   clipped vertices and new created vertices, FACES2 contains references
   to NODES2 vertices.

   Example
   [N E F] = createCube;
   P = createPlane([.5 .5 .5], [1 1 1]);
   [N2 F2] = clipConvexPolyhedronHP(N, F, P);
   drawPolyhedra(N2, F2);

   See also
   meshes3d, polyhedra, planes3d




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 58
CLIPCONVEXPOLYHEDRONHP Clip a convex polyhedron by a plane



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
clipMeshVertices


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 598
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.

   Example
     [v, f] = createSoccerBall;
     box = [-.8 2 -.8 2 -.8 2];
     [v2, f2] = clipMeshVertices(v, f, box);
     figure; drawMesh(v2, f2, 'faceAlpha', .7); 
     view(3); axis equal;

   See also
   meshes3d, clipPoints3d




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 72
CLIPMESHVERTICES Clip vertices of a surfacic mesh and remove outer faces



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 10
createCube


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 885
 -- Function File: [V,E,F] = createCube ()
 -- Function File: [V,F] = createCube ()
 -- Function File: MESH = createCube ()
     Create a 3D mesh representing the unit cube

     [V E F] = createCube Create a unit cube, as a polyhedra
     representation.  c has the form [V E F], where V is a 8-by-3 array
     with vertices coordinates, E is a 12-by-2 array containing indices
     of neighbour vertices, and F is a 6-by-4 array containing vertices
     array of each face.

     [V F] = createCube; Returns only the vertices and the face vertex
     indices.

     MESH = createCube; Returns the data as a mesh structure, with
     fields 'vertices', 'edges' and 'faces'.

     Example
          [n e f] = createCube;
          drawMesh(n, f);

     See also: meshes3d, drawMesh, createOctahedron, createTetrahedron,
     createDodecahedron, createIcosahedron, createCubeOctahedron.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
Create a 3D mesh representing the unit cube



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
createCubeOctahedron


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 723
 -- Function File: [V, E, F] = createCubeOctahedron ()
 -- Function File: MESH = createCubeOctahedron ()
     Create a 3D mesh representing a cube-octahedron

     [V E F] = createCubeOctahedron; Cubeoctahedron can be seen either
     as a truncated cube, or as a truncated octahedron.  V is the
     12-by-3 array of vertex coordinates E is the 27-by-2 array of edge
     vertex indices F is the 1-by-14 cell array of face vertex indices

     [V F] = createCubeOctahedron; Returns only the vertices and the
     face vertex indices.

     MESH = createCubeOctahedron; Returns the data as a mesh structure,
     with fields 'vertices', 'edges' and 'faces'.

     See also: meshes3d, drawMesh, createCube, createOctahedron.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 47
Create a 3D mesh representing a cube-octahedron



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 18
createDodecahedron


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 837
CREATEDODECAHEDRON Create a 3D mesh representing a dodecahedron

   [V, E, F] = createDodecahedron;
   Create a 3D mesh representing a dodecahedron
   V is the 20-by-3 array of vertex coordinates
   E is the 30-by-2 array of edge vertex indices
   F is the 12-by-5 array of face vertex indices

   [V, F] = createDodecahedron;
   Returns only the vertices and the face vertex indices.

   MESH = createDodecahedron;
   Returns the data as a mesh structure, with fields 'vertices', 'edges'
   and 'faces'.

   Example
   [v, e, f] = createDodecahedron;
   drawMesh(v, f);

   Use values given by P. Bourke, see:
   http://local.wasp.uwa.edu.au/~pbourke/geometry/platonic/
   faces are re-oriented to have normals pointing outwards.

   See also
   meshes3d, drawMesh
   createCube, createOctahedron, createIcosahedron, createTetrahedron




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 63
CREATEDODECAHEDRON Create a 3D mesh representing a dodecahedron



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 21
createDurerPolyhedron


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1452
CREATEDURERPOLYHEDRON  Create a mesh representing Durer's polyhedron 

   [V, F] = createDurerPolyhedron
   [V, E, F] = createDurerPolyhedron
   Returns a mesh data structure that represents Durer's polyhedron shown
   in "Melancholia". Vertices are stored in V as Nv-by-3 array of 3D
   coordinates, faces are stored in Nf-by-1 cell array containing the
   vertex indices of each face.
   Several hypotheses exist on the exact geometry of the solid. The one
   described in Mathworld (see references) is used here.

   Durer's polyhedron is generated from a centered unit cube. Several
   transforms are applied succesively:
   * Rotation around Oz by PI / 4
   * Rotation around Oy by asec(sqrt(3))
   * z-scaling by sqrt(1 + 3 / sqrt(5) )
   * truncation by two horizontal planes located at a distance of 
       (3 - sqrt(5)) / 2 from each azimutal vertex.

   Durer's polyhedron is composed of six pentagonal faces and 2 triangular
   faces. Pentagonal faces have angles 126, 108, 72, 108, and 126 degrees.
   triangular faces are equilateral.

   Example
     % Display Durer's polyhedron 
     [v f] = createDurerPolyhedron;
     figure; hold on; set(gcf, 'renderer', 'opengl');
     drawMesh(v, f, 'FaceColor', [.7 .7 .7]);
     axis equal; axis([-1 1 -1 1 -1 1]);
     view(3)

   See also
     meshes3d, createCube, createOctahedron

   References
   http://mathworld.wolfram.com/DuerersSolid.html
   http://en.wikipedia.org/wiki/Drer_graph



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 69
CREATEDURERPOLYHEDRON  Create a mesh representing Durer's polyhedron 



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 17
createIcosahedron


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 621
CREATEICOSAHEDRON Create a 3D mesh representing an Icosahedron.

   MESH = createIcosahedron;
   [V, E, F] = createIcosahedron;
   Create a solid with 12 vertices, and 20 triangular faces. Faces are
   oriented outwards of the mesh.

   [V, F] = createIcosahedron;
   Returns only the vertices and the face vertex indices.

   MESH = createIcosahedron;
   Returns the data as a mesh structure, with fields 'vertices', 'edges'
   and 'faces'.

   Example
     [n, e, f] = createIcosahedron;
     drawMesh(n, f);
   
   See also
   meshes3d, drawMesh
   createCube, createOctahedron, createDodecahedron, createTetrahedron




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 63
CREATEICOSAHEDRON Create a 3D mesh representing an Icosahedron.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 18
createMengerSponge


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 310
CREATEMENGERSPONGE Create a cube with an inside cross removed

   [n, e, f] = createMengerSponge;
   Main use is to test possibility of drawing polyhedra with complex faces
   (polygonal faces with holes)

   Example
   [n, e, f] = createMengerSponge;
   drawMesh(n, f);
   
   See also
   meshes3d, drawMesh




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 61
CREATEMENGERSPONGE Create a cube with an inside cross removed



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
createOctahedron


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1056
CREATEOCTAHEDRON Create a 3D mesh representing an octahedron

   [V, E, F] = createOctahedron;
   Create a 3D mesh representing an octahedron
   V is a 6-by-3 array with vertices coordinate, E is a 12-by-2 array
   containing indices of neighbour vertices, and F is a 8-by-3 array
   containing array of vertex index for each face.

   [V, F] = createOctahedron;
   Returns only the vertices and the face vertex indices.

   MESH = createOctahedron;
   Returns the data as a mesh structure, with fields 'vertices', 'edges'
   and 'faces'.

   Vertices are located on grid vertices:
    ( 1,  0,  0 )
    (  0, 1,  0 )
    (  0,  0, 1 )

   Edge length of returned octahedron is sqrt(2).
   Surface area of octahedron is 2*sqrt(3)*a^2, approximately 6.9282 in
   this case.
   Volume of octahedron is sqrt(2)/3*a^3, approximately 1.3333 in this
   case.

   Example
     [v, e, f] = createOctahedron;
     drawMesh(v, f);

   See also
   meshes3d, drawMesh
   createCube, createIcosahedron, createDodecahedron, createTetrahedron
   createCubeOctahedron




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 60
CREATEOCTAHEDRON Create a 3D mesh representing an octahedron



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
createRhombododecahedron


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 626
CREATERHOMBODODECAHEDRON Create a 3D mesh representing a rhombododecahedron

   [V, E, F] = createRhombododecahedron
   V is a 14-by-3 array with vertex coordinate, 
   E is a 12-by-2 array containing indices of neighbour vertices,
   F is a 8-by-3 array containing vertices array of each face.

   [V, F] = createRhombododecahedron;
   Returns only the vertices and the face vertex indices.

   MESH = createRhombododecahedron;
   Returns the data as a mesh structure, with fields 'vertices', 'edges'
   and 'faces'.

   Example
   [v, e, f] = createRhombododecahedron;
   drawMesh(v, f);


   See also
   meshes3d, drawMesh



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 75
CREATERHOMBODODECAHEDRON Create a 3D mesh representing a rhombododecahedron



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
createSoccerBall


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 509
CREATESOCCERBALL Create a 3D mesh representing a soccer ball

   It is basically a wrapper of the 'bucky' function in matlab.
   [V, E, F] = createSoccerBall
   return vertices, edges and faces that constitute a soccerball
   V is a 60-by-3 array containing vertex coordinates
   E is a 90-by-2 array containing indices of neighbor vertices
   F is a 32-by-1 cell array containing vertex indices of each face
   Example
   [v, f] = createSoccerBall;
   drawMesh(v, f);

   See also
   meshes, drawMesh, bucky



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 60
CREATESOCCERBALL Create a 3D mesh representing a soccer ball



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 17
createTetrahedron


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 801
CREATETETRAHEDRON Create a 3D mesh representing a tetrahedron

   [V, E, F] = createTetrahedron
   create a simple tetrahedron, using mesh representation. The tetrahedron
   is inscribed in the unit cube.
   V is a 4-by-3 array with vertex coordinates, 
   E is a 6-by-2 array containing indices of neighbour vertices,
   F is a 4-by-3 array containing vertices array of each (triangular) face.

   [V, F] = createTetrahedron;
   Returns only the vertices and the faces.

   MESH = createTetrahedron;
   Returns the data as a mesh structure, with fields 'vertices', 'edges'
   and 'faces'.


   Example
   % Create and display a tetrahedron
   [V, E, F] = createTetrahedron;
   drawMesh(V, F);

   See also 
   meshes3d, drawMesh
   createCube, createOctahedron, createDodecahedron, createIcosahedron



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 61
CREATETETRAHEDRON Create a 3D mesh representing a tetrahedron



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
createTetrakaidecahedron


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 818
CREATETETRAKAIDECAHEDRON Create a 3D mesh representing a tetrakaidecahedron

   [V, E, F] = createTetrakaidecahedron;
   Create a mesh structure representing a tetrakaidecahedron, composed of
   both square and hexagonal faces. Tetrakaidecahedron can be used to tile
   the 3D Euclidean space.

   V is a 24-by-3 array with vertex coordinates,
   E is a 36-by-2 array containing indices of neighbour vertices,
   F is a 14-by-1 cell array containing vertex indices array of each face.

   [V, F] = createTetrakaidecahedron;
   Returns only the vertices and the face vertex indices.

   MESH = createTetrakaidecahedron;
   Returns the data as a mesh structure, with fields 'vertices', 'edges'
   and 'faces'.

   Example
   [n, e, f] = createTetrakaidecahedron;
   drawMesh(n, f);
   
   See also
   meshes3d, drawMesh



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 75
CREATETETRAKAIDECAHEDRON Create a 3D mesh representing a tetrakaidecahedron



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
cylinderMesh


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 940
CYLINDERMESH  Create a 3D mesh representing a cylinder

   [V F] = cylinderMesh(CYL)
   Computes vertex coordinates and face vertex indices of a mesh
   representing a 3D cylinder given as [X1 Y1 Z1 X2 Y2 Z2 R].

   Example
     % Draw a rotated cylinder
     cyl = [0 0 0 10 20 30 5];
     [v f] = cylinderMesh(cyl);
     figure;drawMesh(v, f, 'FaceColor', 'r');
     view(3); axis equal;

     % Draw three mutually intersecting cylinders
       p0 = [30 30 30];
       p1 = [90 30 30];
       p2 = [30 90 30];
       p3 = [30 30 90];
       [v1 f1] = cylinderMesh([p0 p1 25]);
       [v2 f2] = cylinderMesh([p0 p2 25]);
       [v3 f3] = cylinderMesh([p0 p3 25]);
       figure; hold on;
       drawMesh(v1, f1, 'FaceColor', 'r');
       drawMesh(v2, f2, 'FaceColor', 'g');
       drawMesh(v3, f3, 'FaceColor', 'b');
       view(3); axis equal
       set(gcf, 'renderer', 'opengl')
  
   See also
     drawCylinder, torusMesh, sphereMesh



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 54
CYLINDERMESH  Create a 3D mesh representing a cylinder



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
drawFaceNormals


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 497
DRAWFACENORMALS Draw normal vector of each face in a mesh

   drawFaceNormals(V, E, F)
   Compute and draw the face normals of the mesh defined by vertices V,
   edges E and faces F. See meshes3d for format of each argument.

   H = drawFaceNormals(...)
   Return handle array to the created objects.

   Example
   % draw face normals of a cube
     drawMesh(v, f)
     axis([-1 2 -1 2 -1 2]);
     hold on
     drawFaceNormals(v, e, f)

   See also
   meshes3d, drawMesh, drawVector3d, quiver3




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 57
DRAWFACENORMALS Draw normal vector of each face in a mesh



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
drawMesh


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1346
 -- Function File: H = drawMesh (VERTICES, FACES)
 -- Function File: H = drawMesh (MESH)
 -- Function File: H = drawMesh (..., COLOR)
 -- Function File: H = drawMesh (..., NAME,VALUE)
     Draw a 3D mesh defined by vertices and faces

     drawMesh(VERTICES, FACES) Draws the 3D mesh defined by vertices
     VERTICES and the faces FACES. vertices is a [NVx3] array containing
     coordinates of vertices, and FACES is either a [NFx3] or [NFx4]
     array containing indices of vertices of the triangular or
     rectangular faces.  FACES can also be a cell array, in the content
     of each cell is an array of indices to the vertices of the current
     face.  Faces can have different number of vertices.

     drawMesh(MESH) Where mesh is a structure with fields 'vertices' and
     'faces', draws the given mesh.

     drawMesh(..., COLOR) Use the specified color to render the mesh
     faces.

     drawMesh(..., NAME, VALUE) Use one or several pairs of parameter
     name/value to specify drawing options.  Options are the same as the
     'patch' function.

     H = drawMesh(...); Also returns a handle to the created patch.

     WARNING: This function doesn't work with gnuplot (as of version
     4.2)

     Example:
              [v f] = createSoccerBall;
              drawMesh(v, f);

     See also: polyhedra, meshes3d, patch.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 44
Draw a 3D mesh defined by vertices and faces



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 14
drawPolyhedron


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 824
DRAWPOLYHEDRON Draw polyhedron defined by vertices and faces

   drawPolyhedron(NODES, FACES)
   Draws the polyhedron defined by vertices NODES and the faces FACES. 
   NODES is a NV-by-3 array containing coordinates of vertices, and FACES
   is either a NF-by3 or NF-by-4 array containing indices of vertices of
   the triangular or rectangular faces.
   FACES can also be a cell array, in the content of each cell is an array
   of indices to the nodes of the current face. Faces can have different
   number of vertices.
   
   H = drawPolyhedron(...);
   Also returns a handle to the created patche.

   Example:
   [n f] = createSoccerBall;
   drawPolyhedron(n, f);

   See also:
   polyhedra, drawMesh, drawPolygon

   ---------

   author : David Legland 
   INRA - TPV URPOI - BIA IMASTE
   created the 10/02/2005.




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 60
DRAWPOLYHEDRON Draw polyhedron defined by vertices and faces



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13
ellipsoidMesh


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 431
ELLIPSOIDMESH Convert a 3D ellipsoid to face-vertex mesh representation

   [V, F] = ellipsoidMesh(ELLI)
   ELLI is given by:
   [XC YC ZC  A B C  PHI THETA PSI],
   where (XC, YC, ZC) is the ellipsoid center, A, B and C are the half
   lengths of the ellipsoid main axes, and PHI THETA PSI are Euler angles
   representing ellipsoid orientation, in degrees.


   See also
   meshes3d, drawEllipsoid, sphereMesh, inertiaEllipsoid




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 71
ELLIPSOIDMESH Convert a 3D ellipsoid to face-vertex mesh representation



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13
faceCentroids


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 778
FACECENTROIDS Compute centroids of a mesh faces

   NORMALS = faceCentroids(VERTICES, FACES)
   VERTICES is a set of 3D points  (as a N-by-3 array), and FACES is
   either a N-by-3 index array or a cell array of indices. The function
   computes the centroid of each face, and returns a Nf-by-3 array
   containing their coordinates.

   Example
     [v e f] = createIcosahedron;
     normals1 = faceNormal(v, f);
     centros1 = faceCentroids(v, f);
     figure; drawMesh(v, f); 
     hold on; axis equal; view(3);
     drawVector3d(centros1, normals1);


   See also:
   meshes3d, drawMesh, faceNormal, convhull, convhulln


 ------
 Author: David Legland
 e-mail: david.legland@grignon.inra.fr
 Created: 2006-07-05
 Copyright 2006 INRA - CEPIA Nantes - MIAJ (Jouy-en-Josas).



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 47
FACECENTROIDS Compute centroids of a mesh faces



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 10
faceNormal


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 797
FACENORMAL Compute normal vector of faces in a 3D mesh

   NORMALS = faceNormal(VERTICES, FACES)
   VERTICES is a set of 3D points (as a N-by-3 array), and FACES is either
   a N-by-3 index array or a cell array of indices. The function computes
   the normal vector of each face.
   The orientation of the normal is defined by the sign of cross product
   between vectors joining vertices 1 to 2 and 1 to 3.


   Example
     [v e f] = createIcosahedron;
     normals1 = faceNormal(v, f);
     centros1 = faceCentroids(v, f);
     figure; drawMesh(v, f); 
     hold on; axis equal; view(3);
     drawVector3d(centros1, normals1);

     pts = rand(50, 3);
     hull = minConvexHull(pts);
     normals2 = faceNormal(pts, hull);

   See also
   meshes3d, drawMesh, convhull, convhulln, drawVector3d



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 54
FACENORMAL Compute normal vector of faces in a 3D mesh



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 19
intersectLineMesh3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 747
INTERSECTLINEMESH3D Intersection points of a 3D line with a mesh

   INTERS = intersectLineMesh3d(LINE, VERTICES, FACES)
   Compute the intersection points between a 3D line and a 3D mesh defined
   by vertices and faces.

   [INTERS, POS, INDS] = intersectLineMesh3d(LINE, VERTICES, FACES)
   Also returns the position of each intersection point on the input line,
   and the index of the intersected faces.
   If POS > 0, the point is also on the ray corresponding to the line. 
   
   Example
     [V, F] = createCube;
     line = [.2 .3 .4 1 0 0];
     pts = intersectLineMesh3d(line, V, F)
     pts =
         1.0000    0.3000    0.4000
              0    0.3000    0.4000

   See also
   meshes3d, triangulateFaces, intersectLineTriangle3d




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 64
INTERSECTLINEMESH3D Intersection points of a 3D line with a mesh



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 18
intersectPlaneMesh


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1564
INTERSECTPLANEMESH Compute the polygons resulting from plane-mesh intersection

   POLYS = intersectPlaneMesh(P, V, F)
   Computes the interection between a plane and a mesh given by vertex and
   face lists. The result is a cell array of polygons.

   The function currently returns at most one polygon in the cell array
   POLYS.


   Example
     % Intersect a cube by a plane
     [v f] = createCube; v = v * 10;
     plane = createPlane([5 5 5], [3 4 5]);
     % draw the primitives
     figure; hold on; set(gcf, 'renderer', 'opengl');
     axis([-10 20 -10 20 -10 20]); view(3);
     drawMesh(v, f); drawPlane3d(plane);
     % compute intersection polygon
     polys = intersectPlaneMesh(plane, v, f);
     drawPolygon3d(polys, 'LineWidth', 2);

     % Intersect a torus by a set of planes, and draw the results
     % first creates a torus slightly shifted and rotated
     torus = [.5 .6 .7   30 10   3 4];
     figure; drawTorus(torus, 'nTheta', 180, 'nPhi', 180);
     hold on; view (3); axis equal; light;
     % convert to mesh representation
     [v, f] = torusMesh(torus, 'nTheta', 64, 'nPhi', 64);
     % compute intersections with collection of planes
     xList = -50:5:50;
     polySet = cell(length(xList), 1);
     for i = 1:length(xList)
         x0 = xList(i);
         plane = createPlane([x0 .5 .5], [1 .2 .3]);
         polySet{i} = intersectPlaneMesh2(plane, v, f);
     end
     % draw the resulting 3D polygons
     drawPolygon3d(polySet, 'lineWidth', 2, 'color', 'k')


   See also
     meshes3d, intersectPlanes, intersectEdgePlane




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 78
INTERSECTPLANEMESH Compute the polygons resulting from plane-mesh intersection



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 18
mergeCoplanarFaces


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1033
MERGECOPLANARFACES Merge coplanar faces of a polyhedral mesh

   [NODES FACES] = mergeCoplanarFaces(NODES, FACES)
   [NODES EDGES FACES] = mergeCoplanarFaces(NODES, EDGES, FACES)
   NODES is a set of 3D points (as a nNodes-by-3 array), 
   and FACES is one of:
   - a nFaces-by-X array containing vertex indices of each face, with each
   face having the same number of vertices,
   - a nFaces-by-1 cell array, each cell containing indices of a face.
   The function groups faces which are coplanar and contiguous, resulting
   in a "lighter" mesh. This can be useful for visualizing binary 3D
   images for example.

   FACES = mergeCoplanarFaces(..., PRECISION)
   Adjust the threshold for deciding if two faces are coplanar or
   parallel. Default value is 1e-5.

   Example
   [v e iFace] = createCube;
   figure; drawMesh(v, iFace); view(3); axis equal;
   [v2 f2] = mergeCoplanarFaces(v, iFace);
   figure; drawMesh(v, f2); 
   view(3); axis equal; view(3);

   See also
   meshes3d, drawMesh, minConvexHull, triangulateFaces




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 60
MERGECOPLANARFACES Merge coplanar faces of a polyhedral mesh



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 19
meshAdjacencyMatrix


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 460
MESHADJACENCYMATRIX Compute adjacency matrix of a mesh from set of faces

   ADJMAT = meshAdjacencyMatrix(FACES)
   Returns a sparse NV-by-NV matrix (NV being the maximum vertex index)
   containing vertex adjacency of the mesh represented by FACES.
   FACES is either a NF-by-3, a NF-by-4 index array, or a Nf-by-1 cell
   array.

   Example
     [v f] = createCube;
     adj = meshAdjacencyMatrix(f);

   See also
     meshes3d, triangulateFaces, smoothMesh



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 72
MESHADJACENCYMATRIX Compute adjacency matrix of a mesh from set of faces



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 18
meshDihedralAngles


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1079
MESHDIHEDRALANGLES Dihedral at edges of a polyhedal mesh

   ALPHA = meshDihedralAngles(V, E, F)
   where V, E and F represent vertices, edges and faces of a mesh,
   computes the dihedral angle between the two adjacent faces of each edge
   in the mesh. ALPHA is a column array with as many rows as the number of
   edges. The i-th element of ALPHA corresponds to the i-th edge.

   Note: the function assumes that the faces are correctly oriented. The
   face vertices should be indexed counter-clockwise when considering the
   supporting plane of the face, with the outer normal oriented outwards
   of the mesh.

   Example
   [v e f] = createCube;
   rad2deg(meshDihedralAngles(v, e, f))
   ans = 
       90
       90
       90
       90
       90
       90
       90
       90
       90
       90
       90
       90

   See also
   meshes3d, polyhedronMeanBreadth, dihedralAngle, meshEdgeFaces


 ------
 Author: David Legland
 e-mail: david.legland@grignon.inra.fr
 Created: 2010-10-04,    using Matlab 7.9.0.529 (R2009b)
 Copyright 2010 INRA - Cepia Software Platform.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 56
MESHDIHEDRALANGLES Dihedral at edges of a polyhedal mesh



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13
meshEdgeFaces


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 10
ok<INUSL>



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 10
ok<INUSL>




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 14
meshEdgeLength


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 10
ok<INUSD>



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 10
ok<INUSD>




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 9
meshEdges


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 178
MESHEDGES Computes array of edge vertex indices from face array

   EDGES = meshEdges(FACES);

   Example
     meshEdges

   See also
     meshes3d, meshEdgeFaces, meshFaceEdges



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 63
MESHEDGES Computes array of edge vertex indices from face array



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
meshFace


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 566
MESHFACE Return the vertex indices of a face in a mesh

   FACE = meshFace(FACES, INDEX)
   Return the vertex indices of the i-th face in the face array. This is
   mainly an utilitary function that manages faces stored either as int
   array (when all faces have same number of sides) or cell array (when
   faces may have different number of edges).

   Example
   meshFace

   See also


 ------
 Author: David Legland
 e-mail: david.legland@grignon.inra.fr
 Created: 2010-10-06,    using Matlab 7.9.0.529 (R2009b)
 Copyright 2010 INRA - Cepia Software Platform.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 54
MESHFACE Return the vertex indices of a face in a mesh



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 17
meshFaceAdjacency


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 455
MESHFACEADJACENCY Compute adjacency list of face around each face


   Example
     % Create a sample 3D mesh
     [v, e, f] = createDodecahedron;
     adjList = meshFaceAdjacency(v, e, f);
     figure; hold on; axis equal; view([100 40]);
     drawMesh(v, f);
     % draw sample face in a different color
     drawMesh(v, f(1, :), 'faceColor', 'b');
     % draw the neighbors of a sample face
     drawMesh(v, f(adjList{1}, :), 'faceColor', 'g')
     
 



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 65
MESHFACEADJACENCY Compute adjacency list of face around each face



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13
meshFaceEdges


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 446
MESHFACEEDGES Computes edge indices of each face

   FE = meshFaceEdges(V, E, F)
   Returns a 1-by-NF cell array containing for each face, the set of edge
   indices corresponding to adjacent edges.

   Example
   meshFaceEdges

   See also
     meshes3d, meshEdgeFaces

 ------
 Author: David Legland
 e-mail: david.legland@grignon.inra.fr
 Created: 2013-08-22,    using Matlab 7.9.0.529 (R2009b)
 Copyright 2013 INRA - Cepia Software Platform.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
MESHFACEEDGES Computes edge indices of each face



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 14
meshFaceNumber


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 512
MESHFACENUMBER Returns the number of faces in this mesh

   NF = meshFaceNumber(V, F)
   NF = meshFaceNumber(V, E, F)
   NF = meshFaceNumber(MESH)
   Returns the number of faces in the given mesh. As the face array may be
   represented either as numeric array or as cell array of indices, this
   function is a convenient way to get the number of faces independanlty
   of the mesh representation.

   Example
     [v f] = createCube;
     meshFaceNumber(v, f)
     ans =
         6

   See also
     meshes3d




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 55
MESHFACENUMBER Returns the number of faces in this mesh



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
meshFacePolygons


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 365
MESHFACEPOLYGONS Returns the set of polygons that constitutes a mesh

   POLYGONS = meshFacePolygons(V, F)
   POLYGONS = meshFacePolygons(MESH)

   Example
     [v f] = createCubeOctahedron;
     polygons = meshFacePolygons(v, f);
     areas = polygonArea3d(polygons);
     sum(areas)
     ans =
         18.9282

   See also
     meshes3d, meshFace, polygonArea3d



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 68
MESHFACEPOLYGONS Returns the set of polygons that constitutes a mesh



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
meshSurfaceArea


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 887
MESHSURFACEAREA Surface area of a polyhedral mesh

   S = meshSurfaceArea(V, F)
   S = meshSurfaceArea(V, E, F)
   Computes the surface area of the mesh specified by vertex array V and
   face array F. Vertex array is a NV-by-3 array of coordinates. 
   Face array can be a NF-by-3 or NF-by-4 numeric array, or a Nf-by-1 cell
   array, containing vertex indices of each face.

   This functions iterates on faces, extract vertices of the current face,
   and computes the sum of face areas.

   This function assumes faces are coplanar and convex. If faces are all
   triangular, the function "trimeshSurfaceArea" should be more efficient.


   Example
     % compute the surface of a unit cube (should be equal to 6)
     [v f] = createCube;
     meshSurfaceArea(v, f)
     ans = 
         6

   See also
   meshes3d, trimeshSurfaceArea, meshVolume, meshFacePolygons,
   polygonArea3d




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
MESHSURFACEAREA Surface area of a polyhedral mesh



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 10
meshVolume


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 874
MESHVOLUME Volume of the space enclosed by a polygonal mesh

   V = meshVolume(VERTS, FACES)
   Computes the volume of the space enclosed by the polygonal mesh
   represented by vertices VERTS (as a Nv-by-3 array of cooridnates) and
   the array of faces FACES (either as a Nf-by-3 array of vertex indices,
   or as a cell array of arrays of vertex indices).

   The volume is computed as the sum of the signed volumes of tetrahedra
   formed by triangular faces and the centroid of the mesh. Faces need to
   be oriented such that normal points outwards the mesh. See:
   http://stackoverflow.com/questions/1838401/general-formula-to-calculate-polyhedron-volume

   Example
     % computes the volume of a unit cube (should be equal to 1...)
     [v f] = createCube;
     meshVolume(v, f)
     ans = 
         1

   See also
   meshes3d, meshSurfaceArea, tetrahedronVolume



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 59
MESHVOLUME Volume of the space enclosed by a polygonal mesh



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 17
meshes3d_Contents


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 3698
 -- Function File: meshes3d_Contents ()
     MESHES3D 3D Surface Meshes Version 1.0 21-Mar-2011 .

     Creation, vizualization, and manipulation of 3D surface meshes or
     polyhedra.

     Meshes and Polyhedra are represented by a couple of variables {V,
     F}: V: Nv-by-3 array of vertices: [x1 y1 z1; ... ; xn yn zn]; F: is
     either a NF-by-3 or NF-by-4 array containing reference for vertices
     of each face, or a NF-by-1 cell array, where each cell is an array
     containing a variable number of node indices.  For some functions,
     the array E of edges is needed.  It consists in a NE-by-2 array
     containing indices of source and target vertices.

     The library provides function to create basic polyhedric meshes
     (the 5 platonic solids, plus few others), as well as functions to
     perform basic computations (surface area, normal angles, face
     centroids ...).  The 'MengerSponge' structure is an example of mesh
     that is not simply connected (multiple tunnels in the structure).

     The drawMesh function is mainly a wrapper to the Matlab 'patch'
     function, allowing passing arguments more quickly.

     Example
              # create a soccer ball mesh and display it
              [n e f] = createSoccerBall;
              drawMesh(n, f, 'faceColor', 'g', 'linewidth', 2);
              axis equal;

     General functions meshFace - Return the vertex indices of a face in
     a mesh computeMeshEdges - Computes edges array from face array
     meshEdgeFaces - Compute index of faces adjacent to each edge of a
     mesh faceCentroids - Compute centroids of a mesh faces faceNormal -
     Compute normal vector of faces in a 3D mesh

     Measures on meshes meshSurfaceArea - Surface area of a polyhedral
     mesh trimeshSurfaceArea - Surface area of a triangular mesh
     meshEdgeLength - Lengths of edges of a polygonal or polyhedral mesh
     meshDihedralAngles - Dihedral at edges of a polyhedal mesh
     polyhedronNormalAngle - Compute normal angle at a vertex of a 3D
     polyhedron polyhedronMeanBreadth - Mean breadth of a convex
     polyhedron

     Basic processing triangulateFaces - Convert face array to an array
     of triangular faces meshReduce - Merge coplanar faces of a
     polyhedral mesh minConvexHull - Return the unique minimal convex
     hull of a set of 3D points polyhedronSlice - Intersect a convex
     polyhedron with a plane.  checkMeshAdjacentFaces - Check if
     adjacent faces of a mesh have similar orientation clipMeshVertices
     - Clip vertices of a surfacic mesh and remove outer faces
     clipConvexPolyhedronHP - Clip a convex polyhedron by a plane

     Typical polyhedra polyhedra - Index of classical polyhedral meshes
     createCube - Create a 3D mesh representing the unit cube
     createOctahedron - Create a 3D mesh representing an octahedron
     createCubeOctahedron - Create a 3D mesh representing a
     cube-octahedron createIcosahedron - Create a 3D mesh representing
     an Icosahedron.  createDodecahedron - Create a 3D mesh representing
     a dodecahedron createTetrahedron - Create a 3D mesh representing a
     tetrahedron createRhombododecahedron - Create a 3D mesh
     representing a rhombododecahedron createTetrakaidecahedron - Create
     a 3D mesh representing a tetrakaidecahedron

     Less typical polyhedra createSoccerBall - Create a 3D mesh
     representing a soccer ball createMengerSponge - Create a cube with
     an inside cross removed steinerPolytope - Create a steiner polytope
     from a set of vectors

     Drawing functions drawFaceNormals - Draw normal vector of each face
     in a mesh drawMesh - Draw a 3D mesh defined by vertices and faces


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 52
MESHES3D 3D Surface Meshes Version 1.0 21-Mar-2011 .



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13
minConvexHull


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 877
MINCONVEXHULL Return the unique minimal convex hull of a set of 3D points

   FACES = minConvexHull(NODES)
   NODES is a set of 3D points  (as a Nx3 array). The function computes
   the convex hull, and merge contiguous coplanar faces. The result is a
   set of polygonal faces, such that there are no coplanar faces.
   FACES is a cell array, each cell containing the vector of indices of
   nodes given in NODES for the corresponding face.

   FACES = minConvexHull(NODES, PRECISION)
   Adjust the threshold for deciding if two faces are coplanar or
   parallel. Default value is 1e-14.

   Example
   [n e f] = createCube;
   f2 = minConvexHull(n);
   drawMesh(n, f);

   See also
   meshes3d, drawMesh, convhull, convhulln


 ------
 Author: David Legland
 e-mail: david.legland@jouy.inra.fr
 Created: 2006-07-05
 Copyright 2006 INRA - CEPIA Nantes - MIAJ (Jouy-en-Josas).



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 73
MINCONVEXHULL Return the unique minimal convex hull of a set of 3D points



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 9
polyhedra


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 957
POLYHEDRA Index of classical polyhedral meshes
   
   Polyhedra are specific meshes, with additional assumptions:
   * the set of faces is assumed to enclose a single 3D domain
   * each face has a neighbor face for each edge
   * some functions also assume that normals of all faces point ouwards 

   Example
   % create a soccer ball mesh and display it
   [n e f] = createSoccerBall;
   drawMesh(n, f, 'faceColor', 'g', 'linewidth', 2);
   axis equal;

   See also
   meshes3d
   createCube, createCubeOctahedron, createIcosahedron, createOctahedron
   createRhombododecahedron, createTetrahedron, createTetrakaidecahedron
   createDodecahedron, createSoccerBall, createMengerSponge
   steinerPolytope, minConvexHull
   polyhedronNormalAngle, polyhedronMeanBreadth


 ------
 Author: David Legland
 e-mail: david.legland@grignon.inra.fr
 Created: 2008-10-13,    using Matlab 7.4.0.287 (R2007a)
 Copyright 2008 INRA - BIA PV Nantes - MIAJ Jouy-en-Josas.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
POLYHEDRA Index of classical polyhedral meshes
   
   Polyhedra are specific ...



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 18
polyhedronCentroid


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 10
ok<INUSD>



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 10
ok<INUSD>




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 21
polyhedronMeanBreadth


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1493
POLYHEDRONMEANBREADTH Mean breadth of a convex polyhedron

   BREADTH = polyhedronMeanBreadth(V, E, F)
   Return the mean breadth (average of polyhedron caliper diameter over
   all direction) of a convex polyhedron.

   The mean breadth is computed using the sum, over the edges of the
   polyhedron, of the edge dihedral angles multiplied by the edge length, 
   the final sum being divided by (4*PI).

   Note: the function assumes that the faces are correctly oriented. The
   face vertices should be indexed counter-clockwise when considering the
   supporting plane of the plane, with the outer normal oriented outwards
   of the polyhedron.

   Typical values for classical polyhedra are:
     cube side a               breadth = (3/2)*a
     cuboid sides a, b, c      breadth = (a+b+c)/2
     tetrahedron side a        breadth = 0.9123*a
     octaedron side a          beradth = 1.175*a
     dodecahedron, side a      breadth = 15*arctan(2)*a/(2*pi)
     icosaehdron, side a       breadth = 15*arcsin(2/3)*a/(2*pi)

   Example
   [v e f] = createCube;
   polyhedronMeanBreadth(v, e, f)
   ans = 
       1.5

   See also
   meshes3d, meshEdgeFaces, meshDihedralAngles, checkMeshAdjacentFaces
   trimeshMeanBreadth

   References
   Stoyan D., Kendall W.S., Mecke J. (1995) "Stochastic Geometry and its
       Applications", John Wiley and Sons, p. 26
   Ohser, J., Muescklich, F. (2000) "Statistical Analysis of
       Microstructures in Materials Sciences", John Wiley and Sons, p.352



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 57
POLYHEDRONMEANBREADTH Mean breadth of a convex polyhedron



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 21
polyhedronNormalAngle


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1069
POLYHEDRONNORMALANGLE Compute normal angle at a vertex of a 3D polyhedron

   THETA = polyhedraNormalAngle(NODES, EDGES, FACES, IND);
   THETA = polyhedraNormalAngle(NODES, FACES, IND);
   where NODES is a set of 3D points, and FACES a set of faces, whose
   elements are indices to NODES array, compute the normal angle at the
   vertex whose index is given by IND.

   THETA = polyhedraNormalAngle(GRAPH, IND);
   Uses a graph structure. GRAPH should contain at least fields : 'nodes'
   and 'faces'.

   Example :
   % create a simple (irregular) tetrahedra
   nodes = [0 0 0;1 0 0;0 1 0;0 0 1];
   faces = [1 2 3;1 2 4;1 3 4;2 3 4];
   % compute normal angle at each vertex
   theta = polyhedronNormalAngle(nodes, faces, 1:size(nodes, 1));
   % sum of normal angles should be equal to 4*pi :
   sum(theta)


   TODO works only for polyhedra with convex faces ! ! !

   See also
   polyhedra, polygon3dNormalAngle

 ------
 Author: David Legland
 e-mail: david.legland@grignon.inra.fr
 Created: 2005-11-30
 Copyright 2005 INRA - CEPIA Nantes - MIAJ (Jouy-en-Josas).



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 73
POLYHEDRONNORMALANGLE Compute normal angle at a vertex of a 3D polyhedron



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
polyhedronSlice


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 504
POLYHEDRONSLICE Intersect a convex polyhedron with a plane.

   SLICE = polyhedronSlice(NODES, FACES, PLANE)
   NODES: a Nx3 array
   FACES: either a cell array or a Nf*3 or Nf*4 array
   PLANE: a plane representation [x0 y0 z0 dx1 dy1 dz1 dx2 dy2 dz2].
   return the intersection polygon of the polyhedra with the plane, in the
   form of a set of ordered points.

   Works only for convex polyhedra.

   Example
   polyhedronSlice

   See also
   polyhedra, clipConvexPolyhedronHP, intersectPlaneMesh




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 59
POLYHEDRONSLICE Intersect a convex polyhedron with a plane.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
readMesh_off


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 135
READMESH_OFF Read mesh data stord in OFF format

   [VERTICES FACES] = readMesh_off(FILNAME)

   Example
   readMesh_off

   See also




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 47
READMESH_OFF Read mesh data stord in OFF format



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 18
removeMeshVertices


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 589
REMOVEMESHVERTICES Remove vertices and associated faces from a mesh

   [V2, F2] = removeMeshVertices(VERTS, FACES, VERTINDS)
   Removes the vertices specified by the vertex indices VERTINDS, and
   remove the faces containing one of the removed vertices.


   Example
     % remove some vertices from a soccerball polyhedron
     [v, f] = createSoccerBall; 
     plane = createPlane([.6 0 0], [1 0 0]);
     indAbove = find(~isBelowPlane(v, plane));
     [v2, f2] = removeMeshVertices(v, f, indAbove);
     drawMesh(v2, f2);
     axis equal; hold on;

   See also
     meshes3d, trimMesh



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 67
REMOVEMESHVERTICES Remove vertices and associated faces from a mesh



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 10
smoothMesh


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 765
SMOOTHMESH Smooth mesh by replacing each vertex by the average of its neighbors 

   V2 = smoothMesh(V, F)
   [V2, F2] = smoothMesh(V, F)
   Performs smoothing of the values given in V, by using adjacency
   information given in F. 
   V is a numeric array representing either vertex coordinate, or value
   field associated to each vertex. F is an array of faces, given either
   as a NF-by-3 or NF-by-4 numeric array, or as a cell array. 
   Artifact adjacencies are added if faces have more than 4 vertices.

   Example
     [v f] = torusMesh([50 50 50 30 10 30 45]);
     v = v + randn(size(v));
     [v2 f] = smoothMesh(v, f, 3);
     figure; drawMesh(v2, f);
     l = light; lighting gouraud

   See also
     meshes3d, meshAdjacencyMatrix, triangulateFaces




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
SMOOTHMESH Smooth mesh by replacing each vertex by the average of its neighbo...



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 10
sphereMesh


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 595
SPHEREMESH  Create a 3D mesh representing a sphere

   [V, F] = sphereMesh(S)
   Creates a 3D mesh representing the sphere S given by [xc yc zy r].

   [V, F] = sphereMesh();
   Assumes sphere is the unit sphere centered at the origin.

   [V, F] = sphereMesh(S, 'nTheta', NT, 'nPhi', NP);
   Specifies the number of discretisation steps for the meridians and the
   parallels.


   Example
     s = [10 20 30 40];
     [v f] = sphereMesh(s);
     drawMesh(v, f);
     view(3);axis equal; light; lighting gouraud;

   See also
     meshes3d, drawSphere, ellipsoidMesh, cylinderMesh, surfToMesh




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 50
SPHEREMESH  Create a 3D mesh representing a sphere



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
steinerPolytope


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 555
STEINERPOLYTOPE Create a steiner polytope from a set of vectors

   [VERTICES FACES] = steinerPolygon(VECTORS)
   Creates the Steiner polytope defined by the set of vectors VECTORS.

   Example
     % Creates and display a planar Steiner polytope (ie, a polygon)
     [v f] = steinerPolytope([1 0;0 1;1 1]);
     fillPolygon(v);

     % Creates and display a 3D Steiner polytope 
     [v f] = steinerPolytope([1 0 0;0 1 0;0 0 1;1 1 1]);
     drawMesh(v, f);
     view(3); axis vis3d

   See also
   meshes3d, drawMesh, steinerPolygon, mergeCoplanarFaces




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 63
STEINERPOLYTOPE Create a steiner polytope from a set of vectors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13
subdivideMesh


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 383
SUBDIVIDEMESH Subdivides each face of the mesh

   [V2 F2] = subdivideMesh(V, F, N)
   Subdivides the mesh specified by (V,F) such that each face F is divided
   into N^2 smaller faces.

   Example
     [v f] = createOctahedron;
     figure; drawMesh(v, f); view(3);
     [v2 f2] = subdivideMesh(v, f, 4);
     figure; drawMesh(v2, f2); view(3)

   See also
     meshes3d, drawMesh




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 46
SUBDIVIDEMESH Subdivides each face of the mesh



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 10
surfToMesh


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 724
SURFTOMESH Convert surface grids into face-vertex mesh

   [V F] = surfToMesh(X, Y)
   [V F] = surfToMesh(X, Y, Z)
   Converts the surface grid given by two or three coordinate arrays into
   a face-vertex quad mesh.

   Example
     % transform a surface into a mesh
     [X,Y] = meshgrid(-2:.2:2, -2:.2:2);                                
     Z = X .* exp(-X.^2 - Y.^2);
     [V F] = surfToMesh(X, Y, Z);
     figure;
     drawMesh(V, F); view(3);

     % Transform surface of a cylinder as a mesh
     [x y z] = cylinder(5*ones(1, 10));
     [v f] = surfToMesh(x, y, z, 'xPeriodic', true);
     figure;
     drawMesh(v, f);
     view(3); axis equal;

   See also
     meshes3d, meshgrid, drawMesh, torusMesh, sphereMesh



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 54
SURFTOMESH Convert surface grids into face-vertex mesh



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 17
tetrahedronVolume


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 628
TETRAHEDRONVOLUME Signed volume of a tetrahedron

   VOL = tetrahedronVolume(TETRA)
   Comptues the siged volume of the tetrahedron TETRA defined by a 4-by-4
   array representing the polyhedron vertices.

   Example
     vi = [0 0 0;1 0 0;0 1 0;0 0 1];
     tetrahedronVolume(vi)
     ans = 
         0.1667

     [V F] = createTetrahedron;
     tetrahedronVolume(V)
     ans = 
         -.3333

   See also
   meshes3d, createTetrahedron, meshVolume

 ------
 Author: David Legland
 e-mail: david.legland@grignon.inra.fr
 Created: 2012-04-05,    using Matlab 7.9.0.529 (R2009b)
 Copyright 2012 INRA - Cepia Software Platform.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
TETRAHEDRONVOLUME Signed volume of a tetrahedron



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 9
torusMesh


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 905
TORUSMESH  Create a 3D mesh representing a torus

   [V, F] = torusMesh(TORUS)
   Converts the torus in TORUS into a face-vertex quadrangular mesh.
   TORUS is given by [XC YC ZY R1 R2 THETA PHI]
   where (XC YZ ZC) is the center of the torus, R1 is the main radius, R2
   is the radius of the torus section, and (THETA PHI) is the angle of the
   torus normal vector (both in degrees).

   [V, F] = torusMesh(TORUS, 'nTheta', NT, 'nPhi', NP)
   Creates a mesh using NP circles, each circle being discretized with NT
   vertices. Default are 60 for both parameters.

   [V, F] = torusMesh()
   Creates a mesh representing a default torus.

   Example
     [v, f] = torusMesh([50 50 50 30 10 30 45]);
     figure; drawMesh(v, f, 'linestyle', 'none');
     view(3); axis equal; 
     lighting gouraud; light;


   See also
     meshes3d, drawTorus, revolutionSurface, cylinderMesh, sphereMesh
     drawMesh



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
TORUSMESH  Create a 3D mesh representing a torus



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
triangulateFaces


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1161
TRIANGULATEFACES Convert face array to an array of triangular faces 

   TRI = triangulateFaces(FACES)
   Returns a 3-columns array of indices, based on the data stored in the
   argument FACES:
   - if FACES is a N-by-3 array, returns the same array
   - if FACES is a N-by-4 array, returns an array with 2*N rows and 3
       columns, splitting each square into 2 triangles (uses first and
       third vertex of each square as diagonal).
   - if FACES is a cell array, split each face into a set of triangles,
       and returns the union of all triangles. Faces are assumed to be
       convex.

   [TRI INDS] = triangulateFaces(FACES)
   Also returns original face index of each new triangular face. INDS has
   the same number of rows as TRI, and has values between 1 and the
   number of rows of the original FACES array.


   Example
     % create a basic shape
     [n e f] = createCubeOctahedron;
     % draw with plain faces
     figure;
     drawMesh(n, f);
     % draw as a triangulation
     tri = triangulateFaces(f);
     figure;
     patch('vertices', n, 'faces', tri, 'facecolor', 'r');

   See also
   meshes3d, drawMesh, mergeCoplanarFaces




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 68
TRIANGULATEFACES Convert face array to an array of triangular faces 



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
trimMesh


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 424
TRIMMESH Reduce memory footprint of a polygonal mesh

   [V2 F2] = trimMesh(V, F)
   Reduces the size occupied by mesh, by keeping only vertices that are
   referenced by at least one face, and relabel face indices.

   Example
     [V F] = createIcosahedron;
     F(13:20, :) = [];
     [V2 F2] = trimMesh(V, F);
     figure; drawMesh(V2, F2)
     view(3); axis equal;
     axis([-1 1 -1 1 0 2])

   See also
     meshes3d



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 52
TRIMMESH Reduce memory footprint of a polygonal mesh



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
trimeshEdgeFaces


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1324
TRIMESHEDGEFACES Compute index of faces adjacent to each edge of a triangular mesh

   EF = trimeshEdgeFaces(FACES)
   EF = trimeshEdgeFaces(VERTICES, FACES)
   EF = trimeshEdgeFaces(VERTICES, EDGES, FACES)
   Compute index array of faces adjacent to each edge of a mesh.
   FACES is a NF-by-3 array containing vertex indices of each face. The
   result EF is a NE-by-2 array containing the indices of the two faces
   incident to each edge. If an edge belongs to only one face, the other
   face index is ZERO.

   The list of edges (as array of source and target vertex indices) can be
   obtained from the function 'meshEdges'.

   Note: faces are listed in increasing order for each edge, and no
   information is kept about relative orientation of edge and face.

   Example
     % compute incidence list of each edge of an octahedron. For example,
     % first edge is incident to faces 1 and 5. Second edge is incident to
     % faces 4 and 8, and so on.
     [v, f] = createOctahedron;
     ef = trimeshEdgeFaces(v, f)
     ef =
          1     5
          4     8
          4     1
          5     8
          2     6
          1     2
          6     5
          3     7
          2     3
          7     6
          3     4
          7     8

   See also
   meshes3d, meshEdgeFaces, trimeshMeanBreadth, meshEdges



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
TRIMESHEDGEFACES Compute index of faces adjacent to each edge of a triangular...



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 18
trimeshMeanBreadth


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 419
TRIMESHMEANBREADTH Mean breadth of a triangular mesh

   MB = trimeshMeanBreadth(VERTICES, FACES)
   Computes the mean breadth (proporitonal to the integral of mean
   curvature) of a triangular mesh.

   Example
     [V, F] = createCube;
     F2 = triangulateFaces(F);
     MB = trimeshMeanBreadth(V, F2)
     MB = 
         1.5000

   See also
   meshes3d, trimeshSurfaceArea, trimeshEdgeFaces, polyhedronMeanBreadth



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 52
TRIMESHMEANBREADTH Mean breadth of a triangular mesh



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 18
trimeshSurfaceArea


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 769
TRIMESHSURFACEAREA Surface area of a triangular mesh

   S = trimeshSurfaceArea(V, F)
   S = trimeshSurfaceArea(V, E, F)
   Computes the surface area of the mesh specified by vertex array V and
   face array F. Vertex array is a NV-by-3 array of coordinates. 
   Face array is a NF-by-3, containing vertex indices of each face.

   Example
     % Compute area of an octahedron (equal to 2*sqrt(3)*a*a, with 
     % a = sqrt(2) in this case)
     [v f] = createOctahedron;
     trimeshSurfaceArea(v, f)
     ans = 
         6.9282

     % triangulate a compute area of a unit cube
     [v f] = createCube;
     f2 = triangulateFaces(f);
     trimeshSurfaceArea(v, f2)
     ans =
         6

   See also
   meshes3d, meshSurfaceArea, trimeshMeanBreadth, triangulateFaces



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 52
TRIMESHSURFACEAREA Surface area of a triangular mesh



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
vertexNormal


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 741
VERTEXNORMAL Compute normals to a mesh vertices

   N = vertexNormal(V, F)
   Computes vertex normals of the mesh given by vertices V and F. 
   V is a vertex array with 3 columns, F is either a NF-by-3 or NF-by-4
   index array, or a cell array with NF elements.

   Example
     % Draw the vertex normals of a sphere
     s = [10 20 30 40];
     [v f] = sphereMesh(s);
     drawMesh(v, f);
     view(3);axis equal; light; lighting gouraud;
     normals = vertexNormal(v, f);
     drawVector3d(v, normals);

   See also
     meshes3d, faceNormal, triangulateFaces

 ------
 Author: David Legland
 e-mail: david.legland@grignon.inra.fr
 Created: 2011-12-19,    using Matlab 7.9.0.529 (R2009b)
 Copyright 2011 INRA - Cepia Software Platform.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 47
VERTEXNORMAL Compute normals to a mesh vertices





