def __init__(self, vertices=[], triangle_indices=[], data=[], **kwargs):
        """Construct a PolyMesh.

        A PolyMesh is a triangle-based mesh. ``vertices`` is the array of points, ``triangle_indices`` is the array of triangle
        indices.
        """
        if not isinstance(vertices, Widget):
            vertices = np.asarray(vertices).flatten()
        triangle_indices = np.asarray(triangle_indices).flatten()

        # If there are no triangle indices, assume vertices are given in the right order for constructing the triangles.
        if triangle_indices.size == 0:
            l_vertices = np.asarray(vertices.array).flatten().size if isinstance(vertices, Widget) else vertices.size

            triangle_indices = np.arange(l_vertices, dtype=np.uint32)

        super(PolyMesh, self).__init__(
            vertices=vertices, triangle_indices=triangle_indices, data=data, **kwargs
        )
Construct a PolyMesh.

        A PolyMesh is a triangle-based mesh. ``vertices`` is the array of points, ``triangle_indices`` is the array of triangle
        indices.
        
ipygany/ipygany.py