Mesh
====

.. py:module:: rhino3dm

.. py:class:: Mesh

   .. py:method:: Mesh()

      Mesh constructor


   .. py:attribute:: IsClosed

      bool: Returns True if every mesh "edge" has two or more faces.

   .. py:attribute:: HasCachedTextureCoordinates

      bool: Will return True if SetCachedTextureCoordinates has been called;
      otherwise will return false.

   .. py:attribute:: HasPrincipalCurvatures

      bool: HasPrincipalCurvatures

   .. py:attribute:: Vertices

      Collections.MeshVertexList: Gets access to the vertices set of this mesh.

   .. py:attribute:: TopologyEdges

      Collections.MeshTopologyEdgeList: Gets the  object associated with this mesh.
      This object stores edge connectivity.

   .. py:attribute:: Faces

      Collections.MeshFaceList: Gets access to the mesh face list.

   .. py:attribute:: Normals

      Collections.MeshVertexNormalList: Gets access to the vertex normal collection in this mesh.

   .. py:attribute:: VertexColors

      Collections.MeshVertexColorList: Gets access to the (optional) vertex color collection in this mesh.

   .. py:attribute:: TextureCoordinates

      Collections.MeshTextureCoordinateList: Gets access to the vertex texture coordinate collection in this mesh.

   .. py:attribute:: PartitionCount

      int: Number of partition information chunks stored on this mesh based
      on the last call to CreatePartitions

   .. py:staticmethod:: CreateFromSubDControlNet(subd, includeTextureCoordinates)

      Create a mesh from a SubD control net

      :return: mesh representing control net on success, None on failure

      :rtype: rhino3dm.Mesh

   .. py:method:: IsManifold(topologicalTest)

      Returns True if every mesh "edge" has at most two faces.

      :return: True if the mesh is manifold, False otherwise.

      :rtype: bool

   .. py:method:: ClearTextureData()

      Removes all texture coordinate information from this mesh.


      :rtype: void

   .. py:method:: ClearSurfaceData()

      Removes surface parameters, curvature parameters and surface statistics from the mesh.


      :rtype: void

   .. py:method:: DestroyTopology()

      Removes topology data, forcing all topology information to be recomputed.


      :rtype: void

   .. py:method:: DestroyTree()

      Destroys the mesh vertex access tree.


      :rtype: void

   .. py:method:: DestroyPartition()

      Destroys mesh partition.


      :rtype: void

   .. py:method:: SetTextureCoordinates(tm, xf, lazy)

      Set texture coordinates using given mapping and applying given transform.
      
      Set lazy to False to generate texture coordinates right away.

      :param TextureMapping tm: Texture mapping
      :param Transform xf: Transform to apply to the texture mapping
      :param bool lazy: Whether to generate lazily (true) or right away (false)


      :rtype: void

   .. py:method:: Compact()

      Removes any unreferenced objects from arrays, re-indexes as needed
      and shrinks arrays to minimum required size.

      :return: True on success, False on failure.

      :rtype: bool

   .. py:method:: Append(other)

      Appends a copy of another mesh to this one and updates indices of appended mesh parts.

      :param rhino3dm.Mesh other: Mesh to append to this one.


      :rtype: void

   .. py:method:: CreatePartitions(maximumVertexCount, maximumTriangleCount)

      In ancient times (or modern smart phone times), some rendering engines
      were only able to process small batches of triangles and the
      CreatePartitions() function was provided to partition the mesh into
      subsets of vertices and faces that those rendering engines could handle.

      :return: True on success

      :rtype: bool
