# doc-cache created by Octave 6.4.0
# name: cache
# type: cell
# rows: 3
# columns: 95
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
Contents


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8818
 MESHES3D 3D Surface Meshes
 Version 1.22 06-Jun-2018 .

   Creation, visualization, 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
   five 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
     [v, e, f] = createSoccerBall;
     drawMesh(v, f, 'faceColor', 'g', 'linewidth', 2);
     axis equal; view(3);
  

 General processing on meshes
   smoothMesh                 - Smooth mesh by replacing each vertex by the average of its neighbors.
   subdivideMesh              - Subdivides each face of the mesh.
   meshVertexClustering       - Simplifies a mesh using vertex clustering.
   triangulateFaces           - Convert face array to an array of triangular faces.
   transformMesh              - Applies a 3D affine transform to a mesh.
   mergeCoplanarFaces         - Merge coplanar faces of a polyhedral mesh.
   meshFacePolygons           - Returns the set of polygons that constitutes a mesh.
   meshFaceCentroids          - Compute centroids of faces in a mesh.
   meshFaceNormals            - Compute normal vector of faces in a 3D mesh.
   meshVertexNormals          - Compute normals to a mesh vertices.
   meshComplement             - Reverse the normal of each face in the mesh.
   averageMesh                - Compute average mesh from a list of meshes.
   meshSilhouette             - Compute the 2D outline of a 3D mesh on an arbitrary plane.

 Intersections and clipping
   intersectLineMesh3d        - Intersection points of a 3D line with a mesh.
   intersectPlaneMesh         - Compute the polygons resulting from plane-mesh intersection.
   polyhedronSlice            - Intersect a convex polyhedron with a plane.
   clipMeshVertices           - Clip vertices of a surfacic mesh and remove outer faces.
   clipConvexPolyhedronHP     - Clip a convex polyhedron by a plane.
   cutMeshByPlane             - Cut a mesh by a plane.
   concatenateMeshes          - Concatenate multiple meshes.
   splitMesh                  - Return the connected components of a mesh.

 Geometric measures on meshes
   meshSurfaceArea            - Surface area of a polyhedral mesh.
   trimeshSurfaceArea         - Surface area of a triangular mesh.
   meshFaceAreas              - Surface area of each face of a mesh.
   meshVolume                 - (Signed) volume of the space enclosed by a polygonal mesh.
   meshEdgeLength             - Lengths of edges of a polygonal or polyhedral mesh.
   meshDihedralAngles         - Dihedral at edges of a polyhedal mesh.
   polyhedronCentroid         - Compute the centroid of a 3D convex polyhedron.
   tetrahedronVolume          - Signed volume of a tetrahedron.
   polyhedronNormalAngle      - Compute normal angle at a vertex of a 3D polyhedron.
   polyhedronMeanBreadth      - Mean breadth of a convex polyhedron.
   trimeshMeanBreadth         - Mean breadth of a triangular mesh.
   isPointInMesh              - Check if a point is inside a 3D mesh.
   distancePointMesh          - Shortest distance between a (3D) point and a triangle mesh.

 Utility functions
   meshFace                   - Return the vertex indices of a face in a mesh.
   meshFaceEdges              - Computes edge indices of each face.
   meshFaceNumber             - Returns the number of faces in this mesh.
   meshEdges                  - Computes array of edge vertex indices from face array.
   meshEdgeFaces              - Compute index of faces adjacent to each edge of a mesh.
   trimeshEdgeFaces           - Compute index of faces adjacent to each edge of a triangular mesh.
   meshFaceAdjacency          - Compute adjacency list of face around each face.
   meshAdjacencyMatrix        - Compute adjacency matrix of a mesh from set of faces.
   checkMeshAdjacentFaces     - Check if adjacent faces of a mesh have similar orientation.
   meshBoundary               - Boundary of a mesh as a collection of 3D line strings.
   meshBoundaryEdgeIndices    - Indices of boundary edges of a mesh.
   meshBoundaryVertexIndices  - Indices of boundary vertices of a mesh.

 Basic edition on meshes
   removeMeshVertices         - Remove vertices and associated faces from a mesh.
   mergeMeshVertices          - Merge two vertices and removes eventual degenerated faces.
   removeMeshFaces            - Remove faces from a mesh by face indices.

 Mesh cleanup
   trimMesh                   - Reduce memory footprint of a polygonal mesh.
   isManifoldMesh             - Check whether the input mesh may be considered as manifold.
   ensureManifoldMesh         - Apply several simplification to obtain a manifold mesh.
   removeDuplicateFaces       - Remove duplicate faces in a face array.
   removeMeshEars             - Remove vertices that are connected to only one face.
   removeInvalidBorderFaces   - Remove faces whose edges are connected to 3, 3, and 1 faces.
   collapseEdgesWithManyFaces - removes mesh edges adjacent to more than two faces

 Creation and conversion
   surfToMesh                 - Convert surface grids into face-vertex mesh.
   triangulateCurvePair       - Compute triangulation between a pair of 3D open curves.
   triangulatePolygonPair     - Compute triangulation between a pair of 3D closed curves.
   cylinderMesh               - Create a 3D mesh representing a cylinder.
   sphereMesh                 - Create a 3D mesh representing a sphere.
   ellipsoidMesh              - Convert a 3D ellipsoid to face-vertex mesh representation.
   torusMesh                  - Create a 3D mesh representing a torus.
   curveToMesh                - Create a mesh surrounding a 3D curve.
   boxToMesh                  - Convert a box into a quad mesh with the same size.
   minConvexHull              - Return the unique minimal convex hull of a set of 3D points.

 Create meshes representing 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.
   createSoccerBall           - Create a 3D mesh representing a soccer ball.
   createStellatedMesh        - Replaces each face of a mesh by a pyramid.
   createDurerPolyhedron      - Create a mesh representing Durer's polyhedron .
   createMengerSponge         - Create a cube with an inside cross removed.
   steinerPolytope            - Create a steiner polytope from a set of vectors.

 Drawing functions
   drawMesh                   - Draw a 3D mesh defined by vertex and face arrays.
   fillMeshFaces              - Fill the faces of a mesh with the specified colors.
   drawFaceNormals            - Draw normal vector of each face in a mesh.

 I/O functions
   readMesh                   - Read a 3D mesh by inferring format from file name.
   writeMesh                  - Write 3D mesh data by inferring format from file name.
   readMesh_off               - Read mesh data stored in OFF format.
   readMesh_ply               - Read mesh data stored in PLY (Stanford triangle) format.
   readMesh_stl               - Read mesh data stored in STL format.
   writeMesh_off              - Write a mesh into a text file in OFF format.
   writeMesh_ply              - Write a mesh into a file in PLY format.
   writeMesh_stl              - Write mesh data in the STL format.




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 56
 MESHES3D 3D Surface Meshes
 Version 1.22 06-Jun-2018 .



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 11
averageMesh


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 131
 Compute average mesh from a list of meshes.

   AVG = averageMesh(MESHLIST)

   Example
   averageMesh

   See also
     meshes3d



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 44
 Compute average mesh from a list of meshes.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 827
 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: 61
 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: 746
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, trimeshMeanBreadth




# 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: 884
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, F] = createCube;
     P = createPlane([.5 .5 .5], [1 1 1]);
     [N2, F2] = clipConvexPolyhedronHP(N, F, P);
     figure('color','w'); view(3); axis equal
     drawPolyhedron(N2, F2);
 
     [v, f] = createSoccerBall;
     p = createPlane([-.5 .5 -.5], [1 1 1]);
     [v2, f2] = clipConvexPolyhedronHP(v, f, p);
     figure('color','w'); view(3); axis equal
     drawMesh(v, f, 'faceColor', 'none');
     drawMesh(v2, f2);

   See also
     meshes3d, polyhedra, planes3d




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




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



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
collapseEdgesWithManyFaces


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 300
 removes mesh edges adjacent to more than two faces

   [V2, F2] = collapseEdgesWithManyFaces(V, F)
   Count the number of faces adjacent to each edge, and collapse the edges
   adjacent to more than two faces. 


   Example
   collapseEdgesWithManyFaces

   See also
       trimMesh, isManifoldMesh



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 51
 removes mesh edges adjacent to more than two faces



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 499
 CONCATENATEMESHES Concatenate multiple meshes.

   [V,F] = concatenateMeshes(V1,F1,V2,F2, ...)
   Returns one mesh represented by vertices V and faces F by concatenating
   the meshes defined by V1, V2, ... and F1, F2, ...

   [V,F] = concatenateMeshes(MESH1, MESH2, ...)
   where MESH1, MESH2, ... are structs or struct arrays with the fields  
   vertices and faces

   See also
     splitMesh
   
 ---------
 Authors: oqilipo (parsing), Alec Jacobson (loop)
 Created: 2017-09-12
 Copyright 2017



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 47
 CONCATENATEMESHES Concatenate multiple meshes.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 772
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: 55
CREATECUBE 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: 724
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'.

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




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 69
CREATECUBEOCTAHEDRON 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: 864
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: 64
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: 1491
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/Dürer_graph



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 70
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: 643
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: 323
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: 62
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: 1094
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: 61
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: 647
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: 76
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: 510
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: 61
CREATESOCCERBALL Create a 3D mesh representing a soccer ball.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 274
CREATESTELLATEDMESH  Replaces each face of a mesh by a pyramid.

   [V2, F2] = createStellatedMesh(V, F)

   Example
     [v, f] = createCube
     [v2, f2] = createStellatedMesh(v, f);
     figure; drawMesh(v2, f2); axis equal; view(3);

   See also
     meshes3d, drawMesh



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 63
CREATESTELLATEDMESH  Replaces each face of a mesh by a pyramid.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 826
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: 62
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: 842
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: 76
CREATETETRAKAIDECAHEDRON Create a 3D mesh representing a tetrakaidecahedron.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 11
curveToMesh


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 864
 Create a mesh surrounding a 3D curve.

   [V, F] = curveToMesh(CURVE)
   Computes the vertices and the faces of the mesh surrounding the
   specified 3D curve.

   [V, F] = curveToMesh(CURVE, THICKNESS)
   Specifies the thickness of the mesh (distance between mesh vertices and
   curve vertices). Default is 0.5.

   [V, F] = curveToMesh(CURVE, THICKNESS, NCORNERS)
   Also specifies the number of mesh vertices around each curve vertex.
   Default is 8.


   Example
     % Creates a tubular mesh around a trefoil knot curve
     t = linspace(0, 2*pi, 200)';
     x = sin(t) + 2 * sin(2 * t);
     y = cos(t) - 2 * cos(2 * t);
     z = -sin(3 * t);
     curve = [x, y, z];
     [v2, f2] = curveToMesh(curve, .5, 16);
     figure; 
     drawMesh(v2, f2);
     axis equal; view(3);
     axis([-4 4 -4 4 -2 2]);
  
   See also
     meshes3d, torusMesh, surfToMesh



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
 Create a mesh surrounding a 3D curve.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 926
CUTMESHBYPLANE Cut a mesh by a plane.

   [ABOVE, IN, BELOW] = cutMeshByPlane(MESH, PLANE)
   where MESH, ABOVE, IN, BELOW are structs with the fields vertices and
   faces, and PLANE is given as a row containing initial point and 2
   direction vectors. ABOVE, IN, BELOW contain the corresponding parts of
   the input mesh.

   [ABOVE_V, ABOVE_F, IN_V, IN_F, BELOW_V,BELOW_F] = ...
       cutMeshByPlane(V, F, PLANE) where V is a [NVx3] array containing
   coordinates and F is a [NFx3] array containing indices of vertices of
   the triangular faces.

   BELOW = cutMeshByPlane(V, F, PLANE, 'part', 'below') BELOW is a struct
   with the fields vertices and faces. Other options are:
       'part'  -   'above': Faces above the plane
               -   'in'   : Faces in the plane
               -   'below': Faces below the plane

   [BELOW_V, BELOW_F] = cutMeshByPlane(MESH, PLANE, 'part', 'below') is
   possible, too.




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
CUTMESHBYPLANE Cut a mesh by a plane.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1408
 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].
   
   [V, F] = cylinderMesh(..., OPT)
   with OPT = 'open' (0) (default) or 'closed' (1), specify if the bases 
   of the cylinder should be included.
   
   [V, F] = cylinderMesh(..., NAME, VALUE);
   Specifies one or several options using parameter name-value pairs.
   Available options are:
   'nPerimeter' the number of circles represeting the perimeter
   'nRho' the number of circles along the hight

   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],'closed','nPeri',40,'nRho',20);
       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: 42
 Create a 3D mesh representing a cylinder.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1988
DISTANCEPOINTMESH  Shortest distance between a (3D) point and a triangle mesh.

   DIST = distancePointMesh(POINT, VERTICES, FACES)
   Returns the shortest distance between the query point POINT and the
   triangular mesh defined by the set of vertex coordinates VERTICES and
   the set of faces FACES. VERTICES is a NV-by-3 array, and FACES is a
   NF-by-3 array of vertex indices.
   If FACES is NF-by-4 array, it is converted to a (NF*2)-by-3 array.

   [DIST, PROJ] = distancePointMesh(...)
   Also returns the projection of the query point on the triangular mesh.

   ... = distancePointMesh(..., 'algorithm', ALGO)
   Allows to choose the type of algorithm. Options are:
   * sequential:   process each face sequentially, using the function
               distancePointTriangle3d 
   * vectorized:   vectorized algorithm, usually faster for large number
               of faces
   * auto:         (default) automatically choose the most appropriate
               between sequential and vectorized.

   Example
     [V, F] = torusMesh();
     F2 = triangulateFaces(F);
     P = [10 20 30];
     [D, PROJ] = distancePointMesh(P, V, F2);
     figure; drawMesh(V, F)
     view(3); axis equal; lighting gouraud; light;
     drawPoint3d(P);
     drawPoint3d(PROJ, 'm*');
     drawEdge3d([P PROJ], 'linewidth', 2, 'color', 'b');

   See also
     distancePointTriangle3d

   References
   * "Distance Between Point and Triangle in 3D", David Eberly (1999)
   https://www.geometrictools.com/Documentation/DistancePoint3Triangle3.pdf
   * <a href="matlab:
     web('https://fr.mathworks.com/matlabcentral/fileexchange/22857-distance-between-a-point-and-a-triangle-in-3d')
   ">Distance between a point and a triangle in 3d</a>, by Gwendolyn Fischer.
   * <a href="matlab:
     web('https://fr.mathworks.com/matlabcentral/fileexchange/52882-point2trimesh------distance%C2%A0between-point-and-triangulated-surface')
   ">Distance Between Point and Triangulated Surface</a>, by Daniel Frisch.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 78
DISTANCEPOINTMESH  Shortest distance between a (3D) point and a triangle mesh.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 607
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
     [v, f] = createCubeOctahedron;
     figure; drawMesh(v, f)
     axis([-2 2 -2 2 -2 2]); axis equal; hold on;
     drawFaceNormals(v, f)
     view(3);

   See also
   meshes3d, drawMesh, drawVector3d, meshFaceNormals, meshFaceCentroids




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 58
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: 1184
DRAWMESH Draw a 3D mesh defined by vertex and face arrays.

   drawMesh(VERTICES, FACES)
   Draws the 3D mesh defined by vertices VERTICES and the faces FACES. 
   vertices is a NV-by-3 array containing coordinates of vertices, and
   FACES is either a NF-by-3 or NF-by-4 array containing face vertex
   indices 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)
   Specifies the mesh as a structure with at least the fields 'vertices'
   and 'faces'. 

   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.

   drawMesh(AX,...) 
   Draw into the axis specified by AX instead of the current axis.


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

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

   See also:
     meshes3d, polyhedra, patch




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 58
DRAWMESH Draw a 3D mesh defined by vertex and face arrays.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 851
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: 61
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: 435
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, equivalentEllipsoid




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



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 405
ENSUREMANIFOLDMESH Apply several simplification to obtain a manifold mesh.

   Try to transform an input mesh into a manifold mesh.

   Not all cases of "non-manifoldity" are checked, so please use with
   care.

   [V2, F2] = ensureManifoldMesh(V, F);
   [V2, F2] = ensureManifoldMesh(MESH);
   MESH2 = ensureManifoldMesh(...);

   Example
   ensureManifoldMesh

   See also
    meshes3d, isManifoldMesh



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 74
ENSUREMANIFOLDMESH Apply several simplification to obtain a manifold mesh.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 959
 Fill the faces of a mesh with the specified colors.

   fillMeshFaces(V, F, VERTEXCOLORS)
   Colorizes a mesh by filling faces with an array of values. The colors
   can be a NV-by-1 array of values, or a NV-by-3 array of values.
   Face filling uses 'interp' coloring mode.

   fillMeshFaces(V, F, FACECOLORS)
   Colorizes the mesh by specifying the value or the color associated to
   each face. Face filling uses 'flat' coloring mode.

   fillMeshFaces(..., PNAME, PVALUE)
   Specifies additional parameters that will be passed to the 'patch'
   function.

   Example
     % Colorize mesh based on z-coordinate of vertices.
     [v, f] = createIcosahedron;
     values = v(:,3);
     figure; axis equal; view(3);
     fillMeshFaces(v, f, values);

     % Colorize mesh using specific color for each face
     [v, f] = createIcosahedron;
     colors = jet(20);
     figure; axis equal; view(3);
     fillMeshFaces(v, f, colors);

   See also
     drawMesh



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 52
 Fill the faces of a mesh with the specified colors.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 745
 Intersection points of a 3D edge with a mesh.

   INTERS = intersectEdgeMesh3d(EDGE, VERTICES, FACES)
   Compute the intersection points between a 3D edge and a 3D mesh defined
   by vertices and faces.

   [INTERS, POS, INDS] = intersectEdgeMesh3d(EDGE, VERTICES, FACES)
   Also returns the position of each intersection point on the input edge,
   and the index of the intersected faces.
   For edges, the values of POS are expected to be comprised between 0 and
   1.
   
   Example
     [V, F] = createCube;
     edge = [-1 0.5 0.5  +3 0.5 0.5];
     pts = intersectEdgeMesh3d(edge, V, F)
     pts =
         1.0000    0.5000    0.5000
              0    0.5000    0.5000

   See also
     meshes3d, interesectLineMesh3d, triangulateFaces




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 46
 Intersection points of a 3D edge with a mesh.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 751
 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: 46
 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: 1591
 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: 61
 Compute the polygons resulting from plane-mesh intersection.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 599
ISMANIFOLDMESH Check whether the input mesh may be considered as manifold.

   B = isManifoldMesh(V, F)
   B = isManifoldMesh(V, E, F)
   Checks if the specified mesh is a manifold. When mesh is a manifold,
   all edges are connected to either 2 or 1 faces.

   [B, HASBORDER] = isManifoldMesh(V, E, F)
   Also checks whether the mesh contains border faces. Border faces
   contains at least one edge which is ajacent to only one face.

   Example
     [V, F] = createOctahedron;
     isManifoldMesh(V, F)
     ans =
       logical
        1

   See also
     meshes3d, ensureManifoldMesh, trimMesh



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 74
ISMANIFOLDMESH Check whether the input mesh may be considered as manifold.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 822
ISPOINTINMESH Check if a point is inside a 3D mesh.

   B = isPointInMesh(PT, V, F)
   Check if the point PT (given as a 1-by-3 array) is inside the mesh
   defined by the vertices V and the face array F. The result is a
   boolean.

   If PT is a N-by-3 point array, the result is a N-by-1 array of logical.

   Example
     [v, f] = torusMesh([50 50 50 30 10 30 45]);
     [x, y, z] = meshgrid(5:5:100, 5:5:100, 5:5:100);
     res = false(size(x));
     res(:) = isPointInMesh([x(:) y(:) z(:)], v, f);
     figure; plot3(x(res), y(res), z(res), 'b.'); axis equal;

   Algorithm:
   The method computes the intersection with a ray starting from the
   point(s) and with a random orientation. Some errors are possible if
   rays crosses the mesh between two or three faces.

   See also
     meshes3d, intersectLineMesh3d



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 51
ISPOINTINMESH Check if a point is inside a 3D mesh.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1031
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, f] = createCube;
   figure; drawMesh(v, f); view(3); axis equal;
   [v2, f2] = mergeCoplanarFaces(v, f);
   figure; drawMesh(v2, f2); 
   view(3); axis equal; view(3);

   See also
     meshes3d, drawMesh, minConvexHull, triangulateFaces




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



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 162
MERGEMESHVERTICES Merge two vertices and removes eventual degenerated faces.

   output = mergeMeshVertices(input)

   Example
   mergeMeshVertices

   See also




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 76
MERGEMESHVERTICES Merge two vertices and removes eventual degenerated faces.



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


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

   ADJMAT = meshAdjacencyMatrix(FACES)
   Returns a sparse NV-by-NV matrix (NV being the largest 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: 73
MESHADJACENCYMATRIX Compute adjacency matrix of a mesh from set of faces.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 722
MESHBOUNDARY Boundary of a mesh as a collection of 3D line strings.

   CURVES = meshBoundary(V, F)

   Example
     % create centered icosahedron
     [v, f] = createIcosahedron;
     v(:,3) = v(:,3) - mean(v(:,3));
     % convert to simili-sphere
     [v2, f2] = subdivideMesh(v, f, 3);
     v3 = normalizeVector3d(v2);
     % clip with plane
     plane = createPlane([0 0 0], [-1 -2 3]);
     [vc, fc] = clipMeshVertices(v3, f2, plane, 'shape', 'plane');
     figure; drawMesh(vc, fc); axis equal; view(3);
     % draw mesh boundary
     curves = meshBoundary(vc, fc);
     hold on; drawPolygon3d(curves{1}, 'linewidth', 2, 'color', 'b');

   See also
     meshes3d, meshBoundaryEdgeIndices, meshBoundaryVertexIndices




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 67
MESHBOUNDARY Boundary of a mesh as a collection of 3D line strings.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
meshBoundaryEdgeIndices


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 867
MESHBOUNDARYEDGEINDICES Indices of boundary edges of a mesh.

   INDS = meshBoundaryVertexIndices(V, F)
   INDS = meshBoundaryVertexIndices(V, E, F)

   Example
     % create centered icosahedron
     [v, f] = createIcosahedron;
     v(:,3) = v(:,3) - mean(v(:,3));
     % convert to simili-sphere
     [v2, f2] = subdivideMesh(v, f, 3);
     v3 = normalizeVector3d(v2);
     % clip with plane
     plane = createPlane([0 0 0], [-1 -2 3]);
     [vc, fc] = clipMeshVertices(v3, f2, plane, 'shape', 'plane');
     figure; drawMesh(vc, fc); axis equal; view(3);
     % draw boundary vertices
     ec = meshEdges(vc, fc);
     inds = meshBoundaryEdgeIndices(vc, ec, fc);
     edges = [vc(ec(inds, 1), :) vc(ec(inds, 2), :)];
     hold on; drawEdge3d(edges, 'linewidth', 2, 'color', 'b');

   See also
     meshes3d, meshBoundary, meshBoundaryVertexIndices, meshEdgeFaces



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 60
MESHBOUNDARYEDGEINDICES Indices of boundary edges of a mesh.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
meshBoundaryVertexIndices


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 767
MESHBOUNDARYVERTEXINDICES Indices of boundary vertices of a mesh.

   INDS = meshBoundaryVertexIndices(V, F)
   INDS = meshBoundaryVertexIndices(V, E, F)

   Example
     % create centered icosahedron
     [v, f] = createIcosahedron;
     v(:,3) = v(:,3) - mean(v(:,3));
     % convert to simili-sphere
     [v2, f2] = subdivideMesh(v, f, 3);
     v3 = normalizeVector3d(v2);
     % clip with plane
     plane = createPlane([0 0 0], [-1 -2 3]);
     [vc, fc] = clipMeshVertices(v3, f2, plane, 'shape', 'plane');
     figure; drawMesh(vc, fc); axis equal; view(3);
     % draw boundary vertices
     inds = meshBoundaryVertexIndices(vc, fc);
     hold on; drawPoint3d(vc(inds,:), 'k*');

   See also
     meshes3d, meshBoundary, meshBoundaryEdgeIndices, meshEdgeFaces



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 65
MESHBOUNDARYVERTEXINDICES Indices of boundary vertices of a mesh.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 303
 Reverse the normal of each face in the mesh.

   [V2, F2] = meshComplement(V, F)

   Example
     [v, f] = createOctahedron;
     meshVolume(v, f)
     ans =
         1.3333
     [v2, f2] = meshComplement(v, f);
     meshVolume(v2, f2)
     ans =
        -1.3333

   See also
     meshes3d, meshVolume



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 45
 Reverse the normal of each face in the mesh.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 958
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, trimeshMeanBreadth, dihedralAngle, meshEdgeFaces




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 57
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: 11
ok<INUSL>



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




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


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



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




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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 187
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: 64
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: 669
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 utility 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
     [v, f] = createCubeOctahedron;
     % some faces are squares
     meshFace(f, 1)
     ans =
          1     2     3     4
     % other are triangles
     meshFace(f, 2)
     ans =
          1     5     2

   See also
     meshes3d, meshFaceCentroid, meshFaceNormals, meshFaceAreas



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 55
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: 470
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: 66
MESHFACEADJACENCY Compute adjacency list of face around each face.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 310
MESHFACEAREAS Surface area of each face of a mesh.

   areas = meshFaceAreas(vertices, faces)

   Example
     [v, f] = createOctahedron;
     meshFaceAreas(v, f)'
     ans =
         1.7321  1.7321  1.7321  1.7321  1.7321  1.7321  1.7321  1.7321

   See also
     meshes3d, meshSurfaceArea, meshFaceCentroids



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 50
MESHFACEAREAS Surface area of each face of a mesh.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 662
MESHFACECENTROIDS Compute centroids of faces in a mesh.

   CENTROIDS = meshFaceCentroids(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 = meshFaceNormals(v, f);
     centros1 = meshFaceCentroids(v, f);
     figure; hold on; axis equal; view(3);
     drawMesh(v, f); 
     drawVector3d(centros1, normals1);


   See also:
     meshes3d, drawMesh, meshFaceNormals, meshFaceAreas, convhull




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 55
MESHFACECENTROIDS Compute centroids of faces in a mesh.



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


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



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



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


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

   NORMALS = meshFaceNormals(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 = meshFaceNormals(v, f);
     centros1 = meshFaceCentroids(v, f);
     figure; drawMesh(v, f); 
     hold on; axis equal; view(3);
     drawVector3d(centros1, normals1);

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

   See also
   meshes3d, meshFaceCentroids, meshVertexNormals, drawFaceNormals
   drawMesh 



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



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 531
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: 56
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: 380
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: 69
MESHFACEPOLYGONS Returns the set of polygons that constitutes a mesh.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 836
MESHSILHOUETTE Compute the 2D outline of a 3D mesh on an arbitrary plane.

   ATTENTION: Very slow brute force approach! Keep the number of faces as
   low as possible.

   SILHOUETTE = meshSilhouette(MESH, PLANE)
   Calculates the silhouette (2D outline) of the MESH projected on the
   PLANE.

   SILHOUETTE = meshSilhouette(MESH) uses the x-y plane.

   SILHOUETTE = meshSilhouette(V, F, ...)

   SILHOUETTE = meshSilhouette(..., 'visu', 1) visualizes the results.
   By default the results are not visualized.

   Example:
     v = [5, 2, 6, 0, 3;  0, 2, 4, 2, 1;  -5, -6, -6, -7, -9]';
     f = [1, 2, 4; 1, 5, 4; 1, 2, 5; 2, 3, 5; 2, 4, 3; 3, 4, 5];
     sil = meshSilhouette(v, f, rand(1,9),'visu',1);
   
   See also:
     projPointOnPlane

   Source:
     Sean de Wolski - https://www.mathworks.com/matlabcentral/answers/68004



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 73
MESHSILHOUETTE Compute the 2D outline of a 3D mesh on an arbitrary plane.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 919
 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, meshFaceAreas,
     meshFacePolygons, polygonArea3d




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



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 975
MESHVERTEXCLUSTERING Simplifies a mesh using vertex clustering.

   [V2, F2] = meshVertexClustering(V, F, SPACING)
   [V2, F2] = meshVertexClustering(MESH, SPACING)
   MESH2 = meshVertexClustering(...)

   Simplifies a mesh using vertex clustering. Input mesh is specified
   either by a pair V, F containing the vertex coordinates and the faces
   informations, or by a structure with fields 'vertices' and 'faces'.

   The SPACING input defines the size of the grid. It can be either a
   scalar (uniform grid) or a 1-by-3 row vector. 

   The output is specified either in two outputs, or in a structure with
   fields 'vertices' and 'faces'.

   Example
     [x, y, z]  = meshgrid(1:100, 1:100, 1:100);
     img = hypot3(x-51.12, y-52.23, z-53.34);
     [faces, vertices] = isosurface(img, 45);
     [v2, f2] = meshVertexClustering(vertices, faces, 10);
     figure; axis equal; axis([0 100 0 100 0 100]);
     drawMesh(v2, f2);

   See also
     reducepatch, smoothMesh



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 63
MESHVERTEXCLUSTERING Simplifies a mesh using vertex clustering.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 597
MESHVERTEXNORMALS Compute normals to a mesh vertices.

   N = meshVertexNormals(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 20];
     [v f] = sphereMesh(s);
     figure; drawMesh(v, f);
     view(3);axis equal; light; lighting gouraud;
     normals = meshVertexNormals(v, f);
     drawVector3d(v, normals*2);

   See also
     meshes3d, meshFaceNormals, triangulateFaces




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 53
MESHVERTEXNORMALS Compute normals to a mesh vertices.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 912
 (Signed) 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, meshComplement



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 59
 (Signed) volume of the space enclosed by a polygonal mesh.



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


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

   FACES = minConvexHull(PTS)
   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(PTS, PRECISION)
   Adjust the threshold for deciding if two faces are coplanar or
   parallel. Default value is 1e-14.

   Example
     % extract square faces from a cube
     [n, e, f] = createCube;
     f2 = minConvexHull(n);
     drawMesh(n, f2);

     % Subdivides and smooths a mesh rpresenting a cube
     [n, e, f] = createCube;
     [n2, f2] = subdivideMesh(n, triangulateFaces(f), 4);
     [n3, f3] = smoothMesh(n2, f2);
     figure; drawMesh(n3, f3);
     axis equal; view(3);
     % merge coplanar faces, making apparent the faces of the original cube
     f4 = minConvexHull(n3);
     figure; drawMesh(n3, f4);
     axis equal; view(3);


   See also
   meshes3d, mergeCoplanarFaces, drawMesh, convhull, convhulln




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 74
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: 1113
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 outwards 

   Most polyhedron creation functions follow the patterns:
   * [V, F] = createXXX();     % returns vertex and face arrays
   * [V, E, F] = createXXX();  % returns also edge array
   * M = createXXX();          % return a data structure with 'vertices',
                               % 'edges' and 'faces' fields.

   Example
   % create a soccer ball mesh and display it
   [n, 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




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



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


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



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




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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1531
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: 58
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: 1070
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: 74
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: 521
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: 8
readMesh


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 629
 Read a 3D mesh by inferring format from file name.

   Usage:
   [V, F] = readMesh(FILENAME)
   Read the data stored in file FILENAME and return the vertex and face
   arrays as NV-by-3 array and NF-by-N array respectively, where NV is the
   number of vertices and NF is the number of faces.

   MESH = readMesh(FILENAME)
   Read the data stored in file FILENAME and return the mesh into a struct
   with fields 'vertices' and 'faces'.

   Example
     mesh = readMesh('apple.ply');
     figure; drawMesh(mesh);
     view([180 -70]); axis equal;

   See also
     meshes3d, writeMesh, readMesh_off, readMesh_ply, readMesh_stl




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 51
 Read a 3D mesh by inferring format from file name.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 685
 Read mesh data stored in OFF format.

   [VERTICES, FACES] = readMesh_off(FILENAME)
   Read the data stored in file FILENAME and return the vertex and face
   arrays as NV-by-3 array and NF-by-N array respectively, where NV is the
   number of vertices and NF is the number of faces.

   MESH = readMesh_off(FILENAME)
   Read the data stored in file FILENAME and return the mesh into a struct
   with fields 'vertices' and 'faces'.

   Example
     [v, f] = readMesh_off('mushroom.off');
     figure; drawMesh(v, f, 'faceColor', [0 1 0], 'edgeColor', 'none')
     view([5 80]); light; lighting gouraud

   See also
     meshes3d, readMesh, writeMesh_off, drawMesh




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
 Read mesh data stored in OFF format.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 307
 Read mesh data stored in PLY (Stanford triangle) format.

   [V, F] = readMesh_ply(FNAME)

   Example
   readMesh_ply

   References
   Wrapper function for Gabriel Peyré's read_ply that is a wrapper
   function of Pascal Getreuer's plyread.

   See also
   meshes3d, readMesh, readMesh_off, readMesh_stl



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 57
 Read mesh data stored in PLY (Stanford triangle) format.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 282
READMESH_STL Read mesh data stored in STL format.

   [VERTICES, FACES] = readMesh_stl(FNAME)

   MESH = readMesh_stl(FNAME)

   Example
   readMesh_stl

   References
   Wrapper function for MATLAB's build-in stlread.

   See also
   meshes3d, readMesh, readMesh_off, readMesh_ply



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
READMESH_STL Read mesh data stored in STL format.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 256
REMOVEDUPLICATEFACES Remove duplicate faces in a face array.

   [V, F] = removeDuplicateFaces(V, F)

   Example
     faces = [1 2 3;2 3 4;3 4 5;2 3 4];
     removeDuplicateFaces(faces)
     ans =
         1 2 3
         2 3 4
         2 3 5

   See also




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 60
REMOVEDUPLICATEFACES Remove duplicate faces in a face array.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 233
REMOVEINVALIDBORDERFACES Remove faces whose edges are connected to 3, 3, and 1 faces.

   [V2, F2] = removeInvalidBorderFaces(V, F)

   Example
   removeInvalidBorderFaces

   See also
     isManifoldMesh, collapseEdgesWithManyFaces



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
REMOVEINVALIDBORDERFACES Remove faces whose edges are connected to 3, 3, and ...



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 409
REMOVEMESHEARS Remove vertices that are connected to only one face.

   [V, F] = removeMeshEars(V, F)
   [V, F] = removeMeshEars(MESH)
   Remove vertices that are connected to only one face. This removes also
   "pending" faces.
   Note that if the mesh has boundary, this may remove some regular faces
   located on the boundary.

   Example
   removeMeshEars

   See also
     meshes3d, ensureManifoldMesh




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 67
REMOVEMESHEARS Remove vertices that are connected to only one face.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1180
REMOVEMESHFACES Remove faces from a mesh by face indices.
   [V2, F2] = removeMeshFaces(V, F, FI) removes faces from the mesh by
   the face indices FI into faces F of the mesh. The mesh is represented 
   by the vertex array V and the face array F. The result is the new set 
   of vertices V2 and faces F2 without the faces indexed by FI. FI can be
   either a linear or a logical index.

   [V2, F2] = removeMeshFaces(MESH, FI) with the struct MESH containing 
   the fields "vertices" (V) and "faces" (F)
   
   MESH2 = removeMeshFaces(V, F, FI) with the struct MESH2 containing the
   fields "vertices" (V2) and "faces" (F2)
   
   MESH2 = removeMeshFaces(MESH, FI) with the structs MESH and MESH2 
   containing the fields "vertices" (V, V2) and "faces" (F, F2)
   
   Example
     [v, f] = createSoccerBall;
     f = triangulateFaces(f);
     fI = true(length(f),1);
     fI(1:length(f)/2) = false;
     [v2, f2] = removeMeshFaces(v, f, fI);
     drawMesh(v, f, 'faceColor', 'none', 'faceAlpha', .2);
     drawMesh(v2, f2, 'faceAlpha', .7);
     view(3); axis equal
   
   See also
   meshes3d, drawMesh
   
 ---------
 Authors: oqilipo, David Legland
 Created: 2017-07-04



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
REMOVEMESHFACES Remove faces from a mesh by face indices.
   [V2, F2] = remov...



# 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: 68
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: 953
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.

   ... = smoothMesh(V, F, NITER)
   Repeat the smoothing procedure NITER times. This is equivalent to
   calling the smoothMesh function NITER times.


   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, drawMesh




# 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: 655
 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. Default values are nTheta = 16 and nPhi = 32.


   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: 40
 Create a 3D mesh representing a sphere.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1346
SPLITMESH Return the connected components of a mesh.

   MESHES = splitMesh(VERTICES, FACES) returns the connected components of
   the mesh defined by vertices and faces as a struct array with the  
   fields vertices and faces sorted by increasing vertex number

   MESHES = splitMesh(MESH) with the vertices-faces-struct MESH is also
   possible
   
   ... = splitMesh(..., 'mostVertices') returns only the component with
   the most vertices. Other options are 'all' (default),
   'maxBoundingBox' that returns the component with the largest bounding 
   box, and 'maxVolume' returns the component with the largest volume.


   Example
     [v1, f1] = boxToMesh([1 0 -1 0 -1 0]);
     [v2, f2] = boxToMesh([-1 0 1 0 -1 0]);
     [v3, f3] = createSoccerBall;
     f1 = triangulateFaces(f1);
     f2 = triangulateFaces(f2);
     f3 = triangulateFaces(f3);
     [vertices, faces] = concatenateMeshes(v1, f1, v3, f3, v2, f2);
     meshes = splitMesh(vertices, faces);
     figure('color','w'); view(3); axis equal
     cmap=hsv(length(meshes));
     for m=1:length(meshes)
         drawMesh(meshes(m), cmap(m,:))
     end

   See also
     concatenateMeshes

   Source
     Local functions are part of the gptoolbox of Alec Jacobson
     https://github.com/alecjacobson/gptoolbox

 ---------
 Author: oqilipo
 Created: 2017-09-17
 Copyright 2017



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 52
SPLITMESH Return the connected components of a mesh.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 556
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: 64
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: 401
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: 47
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: 746
 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: 45
 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: 653
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: 49
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: 931
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: 49
TORUSMESH  Create a 3D mesh representing a torus.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 454
TRANSFORMMESH Applies a 3D affine transform to a mesh.

   MESH2 = transformMesh(MESH1, TRANSFO)
   MESH2 = transformMesh(VERTICES, FACES, TRANSFO)
   [V2, F2] = transformMesh(...)

   Example
     mesh1 = createOctahedron;
     transfo = eulerAnglesToRotation3d([30 20 10]);
     mesh2 = transformMesh(mesh1, transfo);
     figure; axis equal; hold on; drawMesh(mesh2, 'faceColor', 'g'); view(3);

   See also
     meshes3d, transformPoint3d, drawMesh




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 54
TRANSFORMMESH Applies a 3D affine transform to a mesh.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 707
TRIANGULATECURVEPAIR Compute triangulation between a pair of 3D open curves.

   [V, F] = testTriangulateCurvePair(CURVE1, CURVE2)

   Example
     % triangulate a surface patch between two open curves
     % create two sample curves
     t = linspace(0, 2*pi, 100);
     curve1 = [linspace(0, 10, 100)' 5 * sin(t') zeros(100,1)];
     curve2 = [linspace(0, 10, 100)' 2 * sin(t') 2*ones(100,1)];
     figure; hold on;
     drawPolyline3d(curve1, 'b');
     drawPolyline3d(curve2, 'g');
     view(3); axis equal;
     [v, f] = triangulateCurvePair(curve1, curve2);
     figure; drawMesh(v, f, 'linestyle', 'none');
     view(3); axis equal

   See also
     meshes3D, triangulatePolygonPair, meshSurfaceArea



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 76
TRIANGULATECURVEPAIR Compute triangulation between a pair of 3D open curves.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1196
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: 22
triangulatePolygonPair


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1340
 Compute triangulation between a pair of 3D closed curves.

   [V, F] = triangulatePolygonPair(POLY1, POLY2)

   [V, F] = triangulatePolygonPair(..., 'recenter', FLAG)
   Where FLAG is a boolean, specifies whether the second curve should be
   translated to have the same centroid as the first curve. This can
   improve mathcing of vertices. Default is true.


   Example
     % triangulate a surface patch between two ellipses
     % create two sample curves
     poly1 = ellipseToPolygon([50 50 40 20 0], 36);
     poly2 = ellipseToPolygon([50 50 40 20 60], 36);
     poly1 = poly1(1:end-1,:);
     poly2 = poly2(1:end-1,:);
     % transform to 3D polygons / curves
     curve1 = [poly1 10*ones(size(poly1, 1), 1)];
     curve2 = [poly2 20*ones(size(poly2, 1), 1)];
     % draw as 3D curves
     figure(1); clf; hold on;
     drawPolygon3d(curve1, 'b'); drawPoint3d(curve1, 'bo');
     drawPolygon3d(curve2, 'g'); drawPoint3d(curve2, 'go');
     view(3); axis equal;
     [vertices, faces] = triangulatePolygonPair(curve1, curve2);
     % display the resulting mesh
     figure(2); clf; hold on;
     drawMesh(vertices, faces);
     drawPolygon3d(curve1, 'color', 'b', 'linewidth', 2);
     drawPolygon3d(curve2, 'color', 'g', 'linewidth', 2);
     view(3); axis equal;

   See also
     meshes3D, triangulateCurvePair, meshSurfaceArea




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 58
 Compute triangulation between a pair of 3D closed curves.



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


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

   [V2, F2] = trimMesh(V, F)
   Unreferenced vertices are removed.
   Following functions are implemented only for numeric faces:
       Duplicate vertices are removed.
       Duplicate faces are removed.

   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, clipMeshVertices



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 53
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: 1325
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: 692
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

   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: 53
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: 794
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: 53
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: 770
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, meshFaceNormals, 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: 48
VERTEXNORMAL Compute normals to a mesh vertices.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 218
 Write 3D mesh data by inferring format from file name.

   writeMesh(FNAME, V, F)

   writeMesh(FNAME, MESH)

   Example
   writeMesh

   See also
     meshes3d, readMesh, writeMesh_off, writeMesh_ply, writeMesh_stl




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 55
 Write 3D mesh data by inferring format from file name.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 187
WRITEMESH_OFF Write a mesh into a text file in OFF format.

   writeMesh_off(FNAME, V, F)

   Example
   writeMesh_off

   See also
      meshes3d, writeMesh, readMesh_off, writeMesh_ply



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 58
WRITEMESH_OFF Write a mesh into a text file in OFF format.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 519
WRITEMESH_PLY Write a mesh into a file in PLY format.

   writeMesh_ply(FNAME, VERTICES, FACES)

   writeMesh_ply(FNAME, MESH)

   writeMesh_ply(..., FORMAT) also specifies a file format for the written
   file. FORMAT can be either 'binary' (default) or 'ascii'.

   Example
   mesh = createSoccerBall;
   fileName = 'SoccerBall.ply';
   writeMesh_ply(fileName, mesh, 'Bin');
   mesh2 = readMesh(fileName);
   drawMesh(mesh2); axis equal

   See also
   meshes3d, writeMesh, readMesh_ply, writeMesh_off, writeMesh_stl



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 53
WRITEMESH_PLY Write a mesh into a file in PLY format.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 449
WRITEMESH_STL Write mesh data in the STL format.

   writeMesh_stl(FNAME, VERTICES, FACES)

   writeMesh_stl(FNAME, MESH)

   writeMesh_stl(FNAME, VERTICES, FACES, ...) see stlwrite for additonal
   options

   Example
   mesh = cylinderMesh([60 50 40 10 20 30 5], 1);
   writeMesh_stl('Cylinder.stl', mesh, 'bin');

   References
   Wrapper function for MATLAB's build-in stlwrite.

   See also
   meshes3d, writeMesh, writeMesh_off, writeMesh_ply



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
WRITEMESH_STL Write mesh data in the STL format.





