Mesh ==== .. py:class:: py3dm.Mesh Mesh(initial_face_array_capacity: int, initial_vertex_array_capacity: int, has_vertex_normals: bool, has_texture_coordinates: bool) Mesh(mesh: Mesh) Bases: :py:obj:`Geometry` Python bindings for the openNURBS ``ON_Mesh`` class. .. py:method:: is_corrupt(repair: bool, silent_error: bool, text_log: TextLog | None = None) -> bool Check for corrupt data values that are likely to cause crashes. :param repair: If ``True``, ``const_cast<>`` will be used to change the corrupt data so that crashes are less likely. :type repair: bool :param silent_error: If ``True``, ON_ERROR will not be called when corruption is detected. :type silent_error: bool :param text_log: If text_log is not null, then a description of corruption is printed using text_log. :type text_log: TextLog .. rubric:: Notes Ideally, ``is_corrupt`` would be a virtual function on ``ON_Object``, but doing that at this point would break the public SDK. .. py:method:: is_deformable() -> bool Returns ``True`` if object can be accurately modified with "squishy" transformations like projections, shears, an non-uniform scaling. .. py:method:: is_empty() -> bool Returns ``True`` if there are zero vertices or zero faces. .. py:method:: is_not_empty() -> bool Returns ``True`` if there are vertices or faces. .. py:method:: is_valid(text_log: TextLog | None = None) -> bool Tests an object to see if its data members are correctly initialized. :param text_log: If the object is not valid and ``text_log`` is not ``None``, then a brief english description of the reason the object is not valid is appended to the log. The information appended to ``text_log`` is suitable for low-level debugging purposes by programmers and is not intended to be useful as a high level user interface tool. :type text_log: `TextLog`, optional :returns: **success** -- ``True`` if the object is valid or ``False`` if the object is invalid, uninitialized, etc. :rtype: bool .. py:method:: face_count() -> int Return the number of faces. .. py:method:: hidden_vertex_count() -> int Return the number of hidden vertices. .. py:method:: invalid_face_count() -> int Return the number of faces that are invalid. .. py:method:: quad_count() -> int Return the number of faces that are quads. .. py:method:: triangle_count() -> int Return the number of faces that are triangles. .. py:method:: vertex_count() -> int Return the number of vertices. .. py:method:: has_face_normals() -> bool .. py:method:: has_ngons() -> bool .. py:method:: has_principal_curvatures() -> bool .. py:method:: has_surface_parameters() -> bool .. py:method:: has_vertex_colors() -> bool .. py:method:: has_vertex_normals() -> bool .. py:method:: clear_vertex_colors() -> None .. py:method:: flip() -> None Reverses the order of the vertices. The first vertex is not changed. .. py:method:: reserve_vertex_capacity(new_vertex_capacity: int) -> bool Increases the capacity of arrays to be at least the requested capacity. :param new_vertex_capacity: The desired capacity :type new_vertex_capacity: int .. rubric:: Notes This function is useful if you are getting ready to add a known number of vertices and want to increase the dynamic array capacities before you begin adding vertices. .. py:method:: set_quad(face_index: int, a: int, b: int, c: int, d: int) -> bool Returns `True` if the quad has been successfully set. :param face_index: The face index :type face_index: int :param a: First vertex index :type a: int :param b: Second vertex index :type b: int :param c: Third vertex index :type c: int :param d: Fourth vertex index :type d: int .. py:method:: set_triangle(face_index: int, a: int, b: int, c: int) -> bool Returns `True` if the triangle has been successfully set. :param face_index: The face index :type face_index: int :param a: First vertex index :type a: int :param b: Second vertex index :type b: int :param c: Third vertex index :type c: int .. py:method:: set_vertex(vertex_index: int, vertex_location: Point3d) -> bool Returns `True` if the vertex has been successfully set. :param vertex_index: The vertex index :type vertex_index: int :param vertex_location: New vertex location :type vertex_location: int .. py:method:: swap_coordinates(i: int, j: int) -> bool Returns `True` if the vertices with indices ``i`` and ``j`` has been successfully swap.